Write a program to reverse the string. input = google output = elgoole */




  #include<iostream>
  #include<string>
  using namespace std;

void rvrsstr(string a)//rvrsstr=reverse string:user function
{     if(a.size()==0)
        {return;}
        rvrsstr(a.substr(1));
        cout<<a[0];
                          }
    int main()
    {   string a;
         a="google";
         rvrsstr(a);
      return 0;
     }

Comments

Popular posts from this blog

FALSE POSITION METHOD

Write the program to arrange the n queen(queen of chessboard) in n*n matrix such that they can not ATTACK TO eachother.

DNF sorting ( 0s , 1s , 2s, sorting )