Your friend wants to see the pronunciation of his/ her name when it gets reversed. Help him/ her to find the reversed string using program.
Answers
Answered by
16
Answer:
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
int x,i,n;
string str;
getline(cin,str);
reverse(str.begin(),str.end());
cout<<str;
return 0;
}
Answered by
2
Answer:
#include<iostream>
#include<string>
int main()
{
std::string name;
std::getline (std::cin,name);
for( std::string::reverse_iterator i = name.rbegin(); i<name.rend(); i++)
{
std::cout<<*i;
}
}
Explanation:
All test cases passed.
Similar questions
Math,
5 months ago
Science,
5 months ago
Math,
5 months ago
Math,
10 months ago
English,
10 months ago
Chemistry,
1 year ago
India Languages,
1 year ago
World Languages,
1 year ago