How to reverse a string in c++

 Que-make a program for reverse a string?

#include<iostream>
using namespace std;

int main()
{
   string in;
          cout<<"enter string :";
          cin>>in;
        cout<<"entered string is :"<<in<<endl;
      reverse(in.begin(), in.end()) ;
    cout<<"after reversing :"<<in;
    return 0;
}

Result:-



Post a Comment

Previous Post Next Post