REVERSE STRING

Description:

Write a program which takes input as string and then implement the logic to reverse this string. Example : 1.If string is "programr" then the output should be: rmargorp 2.If string is "helloworld" then the output should be: dlrowolleh Test Case 1 Input (stdin) hello Expected Output olleh Test Case 2 Input (stdin) elabsrmuniversity Expected Output ytisrevinumrsbale

Program :

#include <iostream>

#include<string.h>

using namespace std;

int main()

{

int i;

 char s[50];

  cin>>s;

  for(i=strlen(s)-1;i>=0;i--)

    cout<<s[i];

return 0;

}