What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str ("microsoft");
string::reverse_iterator r;
for (r = str.rbegin() ; r < str.rend(); r++ )
cout << *r;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str ("microsoft");
string::reverse_iterator r;
for (r = str.rbegin() ; r < str.rend(); r++ )
cout << *r;
return 0;
}A. microsoft
B. micro
C. tfosorcim
D. tfos
Answer: Option C

Join The Discussion