I cannot figure out why program control does not reach the third printf, right after the for loop.
Why won't the third printf
print?
If I change the for loop to while loop, it still will not print.
Here is the program and output:
main()
{
double nc;
printf ("Why does this work, nc = %f\n", nc);
for (nc = 0; getchar() != EOF; ++nc)
{
printf ("%.0f\n", nc);
}
printf ("Why does this work, nc = %f", nc);
}
The output is:
Why does this work, nc = 0.000000
test
0
1
2
3
4