Home » C++ Programming » Strings » Question
  1. What is the output of this program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main ()
    {
    string s ("InterviewMania");
    string::reverse_iterator Rev;
    for (Rev = s.rbegin(); Rev < s.rend(); Rev++ )
    cout << *Rev;
    return 0;
    }
    1. InterviewMania
    2. 14
    3. ainaMweivretnI
    4. Compilation Error
    5. None of these
Correct Option: C

‘rbegin’ is used to reverse the given the string.



Your comments will be displayed only after manual approval.