#include<iostream.h>
#include<stdio.h>
void main()
{
char a[50],b[50];
int i,j,count=0;
cout<<"enter the sring:";
gets(a);
for(i=0;a[i]!='\0';++i)
count++;
for(j=count-1,i=0;j>=0,i<count;j--,i++)
{
b[i]=a[j];
}
cout<<b;
}

we first the size of the string then we one by one from the last element store the elements in another string of the same size from the starting