Skip to content
CampusEduX

Reverse Words in a Sentence

Easyjavapythonccppjavascript

Given a sentence, reverse the order of its words without reversing the characters inside each word.

Input Format

A single line containing words separated by single spaces, with no leading or trailing spaces.

Output Format

Print the sentence with its words in reverse order, separated by single spaces.

Related Problems

  • Reverse a String
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Check Palindrome
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Count Vowels and Consonants
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...