I wrote a simple c program to count number of characters
#include <stdio.h>
main()
{
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%ld\n", nc);
}
This program is not printing me the characters. On testing different cases, I found that I am stuck in an infinite while()
loop.
Worked!