C program to reverse words in a string or sentence, for example, if the input string is "c++ programming language" then the output will be "++c gnimmargorp egaugnal" i.e. we will invert each word occurring in the input string. Algorithm is very simple just scan the string and keep on storing characters until a space comes. If a space is found then we have found one word so we append null terminator and then reverse the word and then copy the characters of original string with the string obtained on reversing. Then repeat the previous step until the string ends.
Output of program:
computer programming is amazing
retupmoc ginmmargorp si gniama