+ 1

[Solved] C Programming

I am reading The C programming language by K&R. And I came across a code which dont work. For me. https://code.sololearn.com/crSwjnjy8uUu/?ref=app

15th Sep 2019, 9:09 AM
Vaibhav
Vaibhav - avatar
6 Antworten
+ 3
You missed a { and a ; Like this it seems to work: #include <stdio.h> int main() { int nc; nc = 0; while (getchar() != EOF ) { ++nc; printf("%1d\n",nc); } return 0; }
15th Sep 2019, 12:15 PM
Paul
Paul - avatar
0
Yes code is written exactly same manner
15th Sep 2019, 9:27 AM
Vaibhav
Vaibhav - avatar
0
Thanks..
15th Sep 2019, 1:30 PM
Vaibhav
Vaibhav - avatar
0
U can simply count no. Of charecter by using length() function from string.h header file
16th Sep 2019, 1:46 PM
Bullet Raja
Bullet Raja - avatar