Apple Interview Question

Reverting a word using C