I'm a beginner programmer (forgive this very basic question), and I am learning C through the Kernighan and Ritchie book "The C programming language".
I copied this program from the book, and it compiles fine, but when an input is given, the program does nothing.
#include <stdio.h>
int main() {
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%1d\n", nc);
}
The output is supposed to be the number of characters in the input, but nothing is happening