4. Write a program in Java to accept a name containing three words and display the
surname first, followed by the first and middle names.
Sample Input: MOHANDAS KARAMCHAND GANDHI
Sample output: GANDHI MOHANDAS KARAMCHAND
Answers
Answered by
1
Answer:
Sample Input : Mohandas Karamchand Gandhi
Sample Output : Gandhi Mohandas Karamchand
Hint : Here , the last word of the name is placed first and the first word of the name is placed in the middle.
Answered by
3
The answer is given in the image:
Attachments:
Similar questions