Microsoft interview question

Write code to remove redundant spaces from a string in C