Thursday, September 5, 2019

loops - How '

#include

int main()
{
float x=0;
while(x<=.2)
{
printf("%f\n",x);
x=x+0.2;
}
return 0;
}



The output is



0.000000


But it should give..



0.000000

0.200000


I am posting question on stackoverflow for the first time. Please forgive me for my silliness.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...