Question: C program Write a program to remove trailing blanks and tabs. Write pseudo code for the program trim.c before trying to write the code itself.
C program
Write a program to remove trailing blanks and tabs.
Write pseudo code for the program trim.c before trying to write the code itself. When you write trim.c, include the pseudo code in your comments at the beginning of the file. Compile it to be the executable program trim. Trailing blanks and tabs are defined as blanks and tabs that precede an character or an EOF to terminate a line, without any intervening characters of other kinds. You should copy a getline() function of the kind you see in the text to read in lines from stdin into an array, trim the line, and then write out the trimmed line to stdout, continuing until you encounter an EOF. Note: If there are 4 non-blank lines in the input to trim, there should be 4 lines in the output, but lines consisting of only blanks, and tabs, should NOT be output. The trim function should NOT affect any blanks or tabs that do not come at the end of the line.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
