Hi, I'm a complete C newbie, so i'm sorry if this sucks!
Basically, I have a paragraph of text which is being streamed through stdin. All I need the program to do is print the forth line twice using a variable '4p'.
I have a VERY simple line counter program below... How can it be modified to achieve the requirement?
A point in the right direction would be most helpful. ThanksCode:#include < stdio.h> void main() { int c, nl = 0; while ( (c = getchar()) != EOF ) { if (c == '\n') nl++; } printf("number of lines = %d\n",nl); }