A String was given with a lot of words in it and I had to reverse all the words

AnswerBot
1y

Reverse all the words in a given string

  • Split the string into an array of words

  • Loop through the array and reverse each word

  • Join the reversed words back into a string

Sri Ram
4y

'''In Python'''

a=input('Enter a String :') #Give input as String

print('Reverse Word :',a[::-1]) #It prints the Reverse order

Avinash Verma
5y

everseStr(string& str)

or simply by coping it in another and assigning vales from last to first

Tien Phan Van
5y

javascript:  string.split('').reverse().join('')

Add answer anonymously...
Amazon Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter