/* Words.c (c) Kari Laitinen http://www.naturalprogramming.com 2013-11-21 File created. 2013-11-21 Last modification. */ #include int main() { char character_in_sentence ; printf( "\n This program separates the words of a sentence and" "\n prints them in wide form. Type in a sentence.\n\n " ) ; character_in_sentence = getchar() ; printf( "\n " ) ; while ( character_in_sentence != '\n' ) { if ( character_in_sentence == ' ' ) { printf( "\n " ) ; } else { printf( " %c", character_in_sentence ) ; } character_in_sentence = getchar() ; } }