1.

What is the output of this program?
#include <iostream>
using namespace std;
class FirstClass
{
int m;
public:
FirstClass() : m(12)
{
}
FirstClass(int mm): m(mm)
{
}
int getm()
{
return m;
}
};
class SecondClass : public FirstClass
{
int n;
public:
SecondClass(int nn) : n(nn) {}
int getn() { return n; }
};
int main()
{
SecondClass object(105);
cout << object.getm() << " " << object.getn() << endl;
}

A. 12
B. 105
C. 105 12
D. 12 105
E. None of these
Answer» E. None of these


Discussion

No Comment Found

Related MCQs