We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 371b3bd commit ff8a667Copy full SHA for ff8a667
chapter01/1-11.c
@@ -2,11 +2,13 @@
2
* Exercise 1-11. How would you test the word count program? What kinds of input
3
* are most likely to uncover bugs if there are any?
4
*
5
+* By Faisal Saadatmand
6
+*/
7
+
8
+/*
9
* Answer: According to this definition of a word (characters grouped together),
10
* means that inputs such as hyphenated words, word's with apostrophise, etc.,
11
* will be counted as one word.
-*
-* By Faisal Saadatmand
12
*/
13
14
#include <stdio.h>
@@ -20,7 +22,6 @@ int main(void)
20
22
21
23
state = OUT;
24
nl = nw = nc = 0;
-
25
while ((c = getchar()) != EOF) {
26
++nc;
27
if (c == '\n')
@@ -33,5 +34,6 @@ int main(void)
33
34
}
35
36
printf("lines: %d words: %d character: %d\n", nl, nw, nc);
37
38
return 0;
39
0 commit comments