Pergunta de entrevista da empresa Amdocs

I have been asked to write a program to reverse each word which were separated by space . If input is "I am a developer" then output must be "developer a am I".