K&R C Exercise 1-18: Remove Trailing Blanks and Delete Blank Lines
Exercise 1-18. Write a program to remove trailing blanks and tabs from each line of input, and delete entirely blank lines. The challenge here is that you cannot know whether a blank or tab is “trailing” until you have seen everything that follows it on the same line. The solution splits the work into two …