Question: ****I need this in C Language**** I need a line counter program as follows, but I am stuck. -The main while loop (used to end
****I need this in C Language****
I need a line counter program as follows, but I am stuck.
-The main while loop (used to end the program) must detect the condition of double newline. When the user enters two newlines back-to-back, exit the program
-The program will count space characters. Only space characters are counted, not other forms of whitespace such as tabs. The method of counting is special, it will count consecutive spaces as one "space block" and each space block gets one count on the counter. For example, a string of three spaces in a row is counted as one space because they are back-to-back in the input sequence.
The expected output should look like the following (exact output depends on user input):
11111 22222 33333 linecount=1 spacecount=2 yyyyyyyyyyyyyyyyy linecount=2 spacecount=2 y y y y y y linecount=3 spacecount=7 112 112 112 112 linecount=4 spacecount=10 3333333333333333333333333 33333333 linecount=5 spacecount=11 333333 333333 3333333 linecount=6 spacecount=13 abcdefg linecount=7 spacecount=13 yyyyyyyyyy yyyyyyyyyy yyyyyyyyy linecount=8 spacecount=15 linecount=9 spacecount=15 FINAL linecount=9 spacecount=15
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
