Skip to content

Commit

Permalink
Example 1.5.3-1
Browse files Browse the repository at this point in the history
  • Loading branch information
soffes committed Dec 25, 2009
1 parent c50ee28 commit d594db5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/1.5.3-1.c
@@ -0,0 +1,15 @@
// Section 1.5.3 Example 1 from page 19

#include <stdio.h>

/* count lines in input */
main()
{
int c, nl;

nl = 0;
while ((c = getchar()) != EOF)
if (c == '\n')
++nl;
printf("%d\n", nl);
}

0 comments on commit d594db5

Please sign in to comment.