String Exercise Develop a C pegram that will perempt the user to enter a series of words. The program will concatenate e

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

String Exercise Develop a C pegram that will perempt the user to enter a series of words. The program will concatenate e

Post by answerhappygod »

String Exercise Develop A C Pegram That Will Perempt The User To Enter A Series Of Words The Program Will Concatenate E 1
String Exercise Develop A C Pegram That Will Perempt The User To Enter A Series Of Words The Program Will Concatenate E 1 (36.2 KiB) Viewed 26 times
String Exercise Develop a C pegram that will perempt 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 promps the wer for another word. I the user enters the word "DONE" \{all in caps\}, the program will esit the loop and print the list of words. In order to keep the words from joining together, the prowram will need to concatenate a nealine ["Mc−1] after each ward. The pecgram should use a 1000 character single-dimenuienal array char to stere 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 ernpty string ∣∗−7. The program should also use a separate 50 character singledimensianal char array for the word that the user will enter. When the woer enters the word DONE, the program should exit the loop and print the list of words from the singledimensional char array containing the list of words followed by a statemeet of how many characters are in the word list array (including the nealine characters). The input and output of the program will look something like: Cincludes a number of functions to manipulate strings. These functions include: - strcat(string1, string2) which copies (concatenates) string 2 to the end of string1. Make sure stringl is big enough to hoild both strings. - stremp(string1, string2) which compares string 1 fo string 2 and returns 0 if the strings are ecual, a positive number id string f is greater than string 2 , or a negative number at string 2 is greater than string1. Note that uppercase ' Z ' is smaller than lower case 'a'. - strepy (string1, string?) which copies string? to string 1 (replacing string1. Make sure string is big enough to hold string2. - strlen(string1) which returns the sire of string 1 (by counting characters untill the nall character is foundl- To ule any of the above functient, be sure to include cieringh hs in your program. Many more useful string functioes can be found in strinth.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply