While execute this step am getting the value from If
actually it should be from else
#include<stdio.h>
void main()
{
float a=0.9;
clrscr();
if(a<0.9)
printf("value from if a %f",a);
else
printf("value from else a %f",a);
getch();
}
output for the above code is from If.
Just check the below code, this will output correctly to else part
#include<stdio.h>
void main()
{
float a=0.8;
clrscr();
if(a<0.8)
printf("value from if a %f",a);
else
printf("value from else a %f",a);
getch();
}
output for the above code is from else
.
I tried with 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9
0.7,0.9 only goes to if
others goes to else
.
Kindly explain this variation.