diff options
author | Adam Carpenter <gitlab@53hor.net> | 2019-07-09 16:00:48 -0400 |
---|---|---|
committer | Adam Carpenter <gitlab@53hor.net> | 2019-07-09 16:00:48 -0400 |
commit | 39c0cbcc70aff47e17107826aa76cb525c83b122 (patch) | |
tree | df483af220a11aab49e0e3a76eea54f60efbd424 /whitespace_counter.c | |
parent | 583fc81152e120ec5873f8057f11a894bb8b0a91 (diff) | |
download | learning-c-39c0cbcc70aff47e17107826aa76cb525c83b122.tar.xz learning-c-39c0cbcc70aff47e17107826aa76cb525c83b122.zip |
ch2
Diffstat (limited to 'whitespace_counter.c')
-rw-r--r-- | whitespace_counter.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/whitespace_counter.c b/whitespace_counter.c deleted file mode 100644 index ea441e2..0000000 --- a/whitespace_counter.c +++ /dev/null @@ -1,22 +0,0 @@ -#include<stdio.h> - -/* - * Count whitespace in input - */ -main() { - int c, n_whitespace; - - n_whitespace = 0; - - while ((c = getchar()) != EOF) { - if (c == '\n') - ++n_whitespace; - if (c == '\t') - ++n_whitespace; - if (c == ' ') - ++n_whitespace; - } - - - printf("%d\n", n_whitespace); -} |