Read a line, fgets[^] is your friend. If the line read is exactly END than your task is complete: report the line, word and character count. On the other hand, if the line read is not the termination one, then increment the line count, and get the first character (incrementing the character count): if it is a blank then set a flag was_blank = 1; and go on. If it is not a blank then increment the word count and clear the flag: was_blank = 0;. Go on with the next character (if any): increment the character count and if the character is
a blank then set was_blank = 1;
not a blank then, depending on the was_blank flag increment the word count (or do nothing), eventually clear the flag: was_blank = 0;
"In testa che avete, Signor di Ceprano?" -- Rigoletto