C++ Programming :: Objects and Classes - Discussion
Home > C++ Programming > Objects and Classes > MCQs Questions Discussion
2 / 41
What is the output of the C++ program?
# include <stream.h>
class x {
public:
int a;
x();
};
x::x() { a=10; cout<<a; }
class b:public x {
public:
b();
};
b::b() { a=20; cout<<a; }
main ()
{
b temp;
}
what will be the output of this program?
# include <stream.h>
class x {
public:
int a;
x();
};
x::x() { a=10; cout<<a; }
class b:public x {
public:
b();
};
b::b() { a=20; cout<<a; }
main ()
{
b temp;
}
what will be the output of this program?
A10
B20
C2010
D1020
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
TRICK
can not execute or understand the above program. There are multiple issues with it.
Read Full Answer
Report Error
Please Login First Click Here