adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main ()
    {
        string mys;
        char mya[20]= "Hello world";
        mys = mya;
        cout << mys << '\n';
        return 0;
    }

a.

Hello world

b.

Hello

c.

Error

d.

Runtime error

Answer: (a).Hello world

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?