Friday, February 23, 2018

C++ program to find the reverse of Given text.

Source Code:-
-----------------------------------------------------------------------------------------------------------
#include<iostream>
using namespace std;
#include<stdio.h>
#include<string.h>

int main()
{
 char str[100],temp;
 int i,j=0;
 cout<<"Enter the string that you want to reverse:";
 gets(str);  //  gets function for input string
 i=0;
 j=strlen(str)-1;
  while(i<j)
   {
   temp=str[i];
   str[i]=str[j];
   str[j]=temp;
   i++;
   j--;
   }
 cout<<" The Reverse string is: "<<str;

}
--------------------------------------------------------------------------------

Out Put-

No comments:

Post a Comment

Hardware/System Requirements for the Ubuntu 18.04 LTS.

According to the official Website of  Ubuntu minimum system requirements to install Ubuntu 18.04 LTS  are:-  2 GHz dual core processor or...