Apple interview question

Reverting a word using C