[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

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?

A10

B20

C2010

D1020

Answer: Option (Login/Signup)

Show Explanation

Asked In :: Wipro

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here