#include <stdio.h>
main(){
int c;
c = getchar();
while (c!= EOF)
{
putchar(c);
c = getchar();
}
}
Example output:
1. Output: Hi there ^Z?
Hi there ->_ (loop doesn't end)
2. Output: Hi there?
Hi there?
^Z (loop ends)
Why doesn't the loop end in the first case after reading ^Z but it ends in the second case?