Examveda

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;
}

A. microsoft

B. micro

C. tfosorcim

D. tfos

Answer: Option C


Join The Discussion

Related Questions on Classes and Objects in C plus plus