#include<stdio.h> #include<string.h> main() { char str[20]; int i=0; printf("Enter string:"); gets(str); while(str[i]!=' \0') { i++; } i--; printf("\nReverse string:"); while(i>=0) { printf("%c",str[i]); i--; } }