Exercise: Reverse the Words
Write code to solve the problem.
Question
Write code to reverse the order of words in the string variable sentence. The characters inside each word should remain unchanged. Only the order of the words should be reversed.
Sample input:
char sentence[] = "C programming is fun";
Sample output:
fun is programming C
Exercise: Reverse the Words
Write code to solve the problem.
Question
Write code to reverse the order of words in the string variable sentence. The characters inside each word should remain unchanged. Only the order of the words should be reversed.
Sample input:
char sentence[] = "C programming is fun";
Sample output:
fun is programming C