As with my previous question this is also some confusion about an example or two from K&R. Both of these programs are supposed to produce the same answers and I can follow the code easily enough but when I run the program it doesn't print the results. I am guessing that it is supposed to print the no. of characters that I input.
nc = 0;
while (getchar() != EOF)
Why would they not print? Or is my assumption that they should print something wrong?
for (nc = 0; getchar() != EOF; ++nc)
printf ("%.0f\n", nc);