Line counting - overview
- Politechnika Śląska
- Fundamentals of Computer Programming
Line counting #include /* count lines in input */ int main() { int c, nl; nl = 0; /* the number of lines so far */ while ((c = getchar()) != EOF) if (c == '\n') /* new line found */ nl++; printf("%d\n", nl); return 0; } ...