C Exercises: Accepts some text from the user and prints each word of that text in separate line.
Print each word of input text on a new line
Write a C program that accepts some text from the user and prints each word of that text on a separate line.
Sample Solution:
C Code:
Sample Output:
Input some text: The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to split an input sentence into words and print each word on a separate line without using strtok.
- Write a C program to print each word of a user-input string on a new line using pointer manipulation.
- Write a C program to break a sentence into words and output them line-by-line with proper handling of punctuation.
- Write a C program to process a string and display each word on a new line using a loop and character comparisons.
C programming Code Editor:
Previous:Write a C program to replace more than one blanks with a single blank in a input string.
Next: Write a C program that takes some integer values from the user and print a histogram.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.