Question: in language C please. 1) In this question you are required to implement two recursive functions (no loops are allowed!!) a) A recursive function void
in language C please.


1) In this question you are required to implement two recursive functions (no loops are allowed!!) a) A recursive function void reverseCharacters(char *str,int n) That has that gets a string str and its length n (not including the final character) and replace the order of characters in the string, such that the first character becomes the last one, the second character becomes the character that comes before the last etc.. Pay attention: If the order of the string is odd, the character at index n/2 stays in place The function does not print anything nor return any value. . For example, the word "Yummy" should turn to "ymmuY". b) A recursive function void PrintReverseWordsOrder(char *s, int i) That gets a pointer to a string, representing sentence that has some number of words (separated by the space character", and additional helper variable i, and prints the words appeared in s in reverse order, so that now the first word in the original sentence is the last word of the modified sentence etc. The order of characters in any word is not changed. For example, the sentence "The book is on the table" should turn to "table the on is book The" . You could assume that there is a single space between any two words and there are no spaces in the beginning nor the end of the string You can modify the string * The value of the helper variable in the first call should be zero (as in the example). . Printing the string could be done with %s in printf. You could assume that the maximum length of the sentence in part b is 30, and the maximum length of the word in part a to reverse is 10 * To scan the sentence you could not use scanf with %s (which is not recommended in general! because it contains spaces, you might use scanf char by char or preferably the getchar function Hint: change spaces in the string to '10' For example, the output of the program on the sentence The book is on the table and the word Yummy should be nter your sentence to reverse the order of words: The book is on the table The reversed order of words of your sentence is: table the on is book The nter your word to reverse: Yummy The reversed order of the string Yummy is mmu
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
