Question
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
string str ("microsoft");
7.
string::reverse_iterator r;
8.
for (r = str.rbegin() ; r < str.rend(); r++ )
9.
cout
What is the output of this program?
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
string str ("microsoft");
7.
string::reverse_iterator r;
8.
for (r = str.rbegin() ; r < str.rend(); r++ )
9.
cout
Answer: Option C
Was this answer helpful ?
'rbegin' is used to reverse the given the string.
Output:
$ g++ stri1.cpp
$ a.out
tfosorcim
Was this answer helpful ?
Submit Solution