Siemens Healthineers interview question

Write a program to reverse words of string.