#include <stdio.h>
#include <string.h>
void swap(char *a,char *b)
{
char c;
c=*a;
*a=*b;
*b=c;
}
void reverse(char *s,char *t){
if(s>t){
swap(*s,*t);
reverse(++s,--t);
}
}
void main(){
char s[100],*p;
int len;
printf("Please enter a string:\n");
gets(s);
len=strlen(s)-1;
p=&s[len];
reverse(s,p);
printf("Reverse the string we will get:\n%s\n",s);
getch();
}