I've been trying to do this question for a while. It goes as follows:
Given a string S containing a few words. If the count of words in the string S is even then reverse its even position’s words else reverse its odd position, push reversed words at the starting of a new string and append the remaining words as it is in order. For example:
Input string: Ashish Yadav Abhishek Rajput Sunil Pundir
Output string: ridnuP tupjaR vadaY Ashish Abhishek Sunil
Do we have to take a string input from user and then convert it into an array and then split it from the middle...? I am very confused. Please give advice.