John Deere interview question

Basic c++ questions , string reverse program