C program to swap two words in a string

C program to swap two words in a string

Output:

Enter a string with two words:
swap this
Final string is:
     this swap

Implementation: