1.

What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string s ("Nobody does like Interview Mania.");
string key ("Nobody");
size_t f;
f = s.rfind(key);
if (f != string::npos)
s.replace (f, key.length(), "Everybody");
cout << s << endl;
return 0;
}

A. Nobody
B. Everybody
C. Everybody does like Interview Mania.
D. Nobody does like Interview Mania.
E. None of these
Answer» D. Nobody does like Interview Mania.


Discussion

No Comment Found

Related MCQs