Home » C++ Programming » Strings » Question
  1. What is the output of this program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main ()
    {
    string name ("Manjesh");
    string family ("Ojha");
    name += " Interview Mania ";
    name += family;
    name += '\n';
    cout << name;
    return 0;
    }
    1. Manjesh
    2. Ojha
    3. Interview Mania
    4. Manjesh Ojha Interview Mania
    5. Manjesh Interview Mania Ojha
Correct Option: E

In this program, We are adding the characters at the end of the current value.



Your comments will be displayed only after manual approval.