Home » C++ Programming » Classes & Objects » Question
  1. What is the output of this program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main()
    {
    string str = "Interview Mania";
    str.insert(str.size() / 3, " * ");
    cout << str << endl;
    return 0;
    }
    1. Interview
    2. Mania
    3. Inter * view Mania
    4. Interview Mania
    5. None of these
Correct Option: C

In this program, We are placing the string based on the size of the string and it is a string hierarchy.



Your comments will be displayed only after manual approval.