Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main ()
    {
    string Str;
    char StrArray[30]= "Hello Interview Mania";
    Str = StrArray;
    cout << Str << '\n';
    return 0;
    }
    1. Hello
    2. Interview
    3. Mania
    4. Hello Interview Mania
    5. Compilation Error
Correct Option: D

In this program, We converted the char values into the string.



Your comments will be displayed only after manual approval.