diff --git a/KNR C/ex1_8.c b/KNR C/ex1_8.c new file mode 100644 index 0000000..aa2a727 --- /dev/null +++ b/KNR C/ex1_8.c @@ -0,0 +1,19 @@ +#include + +int main(){ + + int a = getchar(); + int counter = 0; + + while (a != EOF){ + if (a == '\n' || a == '\t' || a == ' ') + ++counter; + + a = getchar(); + } + +printf("%d", counter); + +return 0; + +}