adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    class Cat
    {
        public:
        int age;
        int weight;
    };
    int main()
    {
        Cat f;
        f.age = 56;
        cout << "Gates is " ;
        cout << f.age << " years old.\n";
    }

a.

Gates is

b.

Gates is 56 years old

c.

Error

d.

None of the mentioned

Answer: (b).Gates is 56 years old

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?