Q:

Output of following program?

0

Output of following program?

class A
{
 protected: int a,b;
 public: void disp()
 { 
  cout<<a<<b; 
 }
};
class B:public A
{
 int x,y;
};

  1. Garbage value
  2. Compile time error
  3. Runtime error
  4. Runs but gives random values as output

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

 (b).Compile time error

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now