#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
                char str[10],temp;
                int i,j;
                clrscr();
                cout<<"Enter The String : ";
                cin>>str;
                cout<<"\nThe Reverse of "<<str<<" : ";
                j=strlen(str)-1;
                for(i=0;i<j;i++)
                                {
                                temp=str[i];
                                str[i]=str[j];
                                str[j]=temp;
                                j--;
                                }
                cout<<str;
                getch();
}

133.PNG

Advertisements