Develop a C program that will prompt the user to enter a series of words. The program will concatenate each word to a character
Develop a C program that will prompt the user to enter a series of words. The program will concatenate each word to a character array (building up a list of words one word at a time). Then the program will prompt the user for another word. If the user enters the word "DONE" (all in caps), the program will exit the loop and print the list of words. In order to keep the words from joining together, the program will need to concatenate a newline (" ") after each word. The program should use a 1000 character single-dimensional array char to store the list of words. You can assume that the user will not exceed the 1000 character size. The array should be initialized to have an empty string (). The program should also use a separate 50 character single-dimensional char array for the word that the user will enter. When the user enters the word DONE, the program should exit the loop and print the list of words from the single- dimensional char array containing the list of words followed by a statement of how many characters are in the word list array (including the newline characters). The input and output of the program will look something like: Please enter a word: The Please enter a word: quick Please enter a word: brown Please enter a word: fox Please enter a word: jumps Please enter a word: OVER Please enter a word: the Please enter a word: lazy Please enter a word: dog. Please enter a word: DONE You entered: The quick brown fox jumped OVER the lazy dog. The total number of characters including newlines is 45.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started