Line Counts Program In C Language

Line Counting Program In C Language
#include
void main()
{
	int c, nl;
	nl=0;
	while((c=getchar()) !=EOF)
		if(c=='\n')
			++nl;
		printf("%d\n",nl);
	getch();
}

Output

[caption id="attachment_1529" align="aligncenter" width="648"]Line Counting Program In C Language Line Counting Program In C Language[/caption]