I have 2 queries 1. what this line means which is in bold 2.Up to how many times it will loop back Code: main() { int c ; int count=0 ; [B]while ( ( c = getchar() ) != EOF )[/B] count ++ ; printf( "%d characters\n" , count ); }
1. what this line means which is in bold while ( ( c = getchar() ) != EOF ) In this line, first getchar waits to for input from user and then the iput is assigned to "c ", and "c" value is compared against EOF. 2.Up to how many times it will loop back In windows, getchar returns EOF when the iput is (ctrl + z). So it loop backs until (ctrl + z) is entered. So, count prints, number of characters read so far.