1
0
mirror of https://github.com/krislamo/knrc.git synced 2024-09-19 21:00:35 +00:00

Character counting example v2

This commit is contained in:
Kris Lamoureux 2021-11-09 00:20:01 -05:00
parent 72093b7232
commit 3512ae49ab
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925

View File

@ -2,10 +2,9 @@
int main() int main()
{ {
long nc; double nc;
nc = 0; for (nc = 0; getchar() != EOF; ++nc)
while (getchar() != EOF) ;
++nc; printf("%.0f\n", nc);
printf("%ld\n", nc);
} }