first commit!
This commit is contained in:
10
line_count.c
Normal file
10
line_count.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int chars, lines, character;
|
||||
|
||||
for (chars = 0, lines = 0; (character = getchar()) != EOF; ++chars)
|
||||
if (character == '\n')
|
||||
++lines;
|
||||
printf("\n%d lines were inputted\n", lines);
|
||||
}
|
Reference in New Issue
Block a user