Question: Please write a main program in C that tests for all 4 of the following cases as stated in the attached image, follow instructions as

Please write a main program in C that tests for all 4 of the following cases as stated in the attached image, follow instructions as image describes.Please write a main program in C that tests for all 4

Write a main program to test function mergeWords given below. You must test it for the following cases: (1) os being an empty string (e.g. (2) os having a single word (e.g. "hello") (3) os having 2 words and (e.g. "hello friends") (4) oS having multiple words (e.g. "hello friends how are you") For each test case, you must print the expected output and the actual output You are given a function called merge Words that takes 2 string parameters. The first parameter (oS) is a sentence, given as input to the function. The second para string ("). The function merges all words in os toget ther and stores the result in ms (so that msS now has the same content as os minus the spaces). Signature of mergeWords: (char (SIZE], char [SIZE)->void Example: char astring [SIZE]-"I can program now"; char mstring [SIZE] = "" Call to mergeWords(aString, mString) modifies mString so that it now stores "Icanprogramnow void mergewords(char os[SIZE], char ms[SIZE]) int i, j: i = e; j=0; while (i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!