I was going through some basic C codes and then I found a program intended to count numbers from a given input:
#include <stdio.h>
// count characters given as input
int main()
{
double nc;
for(nc = 0; getchar() != EOF; ++nc)
;
printf("%.0f\n", nc);
}
But as I ran the program on terminal (I'm using Debian 11), I'm getting no output for whatever I give as input. But pressing Ctrl+C is terminating the program as it should.