Q:

Predict the output of the program

0

Predict the output of the program.

class A
{
 public int i;
};
void main()
{
 A x;
 A y=x;
 x.i=10;
 y.i=20;
 y.i++;
 y.i=20;
 cout&l;<tx.i;
}

  1. 10
  2. 20
  3. 21
  4. 0

All Answers

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

 (b).20

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

total answers (1)

OBJECT ORIENTED PROGRAMMING - OBJECTS AND POINTERS MCQ

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
If programmer doesn’t define any copy assignment... >>
<< How the argument passed to a function get initiali...