21. 

Which of the following statement is correct about the program given below?

#include<iostream.h> 
int i, j; 
class IndiaBix
{
    public:
    IndiaBix(int x = 0, int y = 0)
    {
        i = x; 
        j = x; 
        Display();
    }
    void Display()
    {
        cout<< j <<" ";
    } 
}; 
int main()
{
    IndiaBix objBix(10, 20); 
    int &s = i; 
    int &z = j; 
    i++;
    cout<< s-- << " " << ++z; 
    return 0; 
}

A. The program will print the output 0 11 21.
B. The program will print the output 10 11 11.
C. The program will print the output 10 11 21.
D. The program will print the output 10 11 12.
E. It will result in a compile time error.

22. 

Which of the following statement is correct about the program given below?

#include<iostream.h> 
int x, y; 
class BixTest
{
    public:
    BixTest(int xx = 0, int yy = 0)
    {
        x = xx;
        y = yy;
        Display(); 
    } 
    void Display()
    {
        cout<< x << " " << y << " ";
    }
};
int main()
{
    BixTest objBT(10, 20); 
    int &rx = x; 
    int &ry = y; 
    ry = x;
    rx = y;
    cout<< rx--; 
    return 0; 
}

A. The program will print the output 0 0 10.
B. The program will print the output 10 20 10.
C. The program will print the output 10 20 9.
D. It will result in a compile time error.

23. 

Which of the following statement is correct about the program given below?

#include<iostream.h> 
class IndiaBix
{
    int a, b, c; 
    public:
    void SetValue(int x, int y ,int z)
    {
        a = x;
        b = y;
        c = z;
    } 
    void Display()
    {
        cout<< a << " " << b << " " << c;
    } 
}; 
int main()
{
    IndiaBix objBix;
    int x  = 2;
    int &y = x;
    y = 5;
    objBix.SetValue(x, ++y, x + y);
    objBix.Display();
    return 0; 
}

A. The program will print the output 5 6 10.
B. The program will print the output 6 6 10.
C. The program will print the output 6 6 12.
D. It will result in a compile time error.

24. 

What will be the output of the program given below?

#include<iostream.h> 
class BixBase
{
    int x;
    public:
    BixBase(int xx = 0)
    {
        x = xx; 
    }
    void Display()
    {
        cout<< x ;
    }
};
class BixDerived : public BixBase
{
    int y; 
    public:
    BixDerived(int yy = 0)
    {
        y = yy;
    }
    void Display()
    {
        cout<< y ;
    }
};
int main()
{
    BixBase objBase(10); 
    BixBase &objRef = objBase;

    BixDerived objDev(20); 
    objRef = objDev;

    objDev.Display(); 
    return 0; 
}

A. 0
B. 10
C. 20
D. Garbage-value
E. It will result in a compile-time/run-time error.

25. 

Which of the following statement is correct about the program given below?

#include<iostream.h> 
class IndiaBix
{
    int x, y; 
    public:
    IndiaBix(int xx = 0, int yy = 0)
    {
        x = xx; 
        y = yy;
    }
    void Display()
    {
        cout<< x << " " << y;
    }
    IndiaBix operator +(IndiaBix z)
    {
        IndiaBix objTemp;
        objTemp.x = x + z.x;
        objTemp.y = y + z.y;
        return objTemp; 
    }
};
int main()
{
    IndiaBix objBix1(90, 80); 
    IndiaBix objBix2(10, 20); 
    IndiaBix objSum; 
    IndiaBix &objRef = objSum; 
    objRef = objBix1 + objBix2; 
    objRef.Display(); 
    return 0; 
}

A. It will result in a runtime error.
B. It will result in a compile time error.
C. The program will print the output 9 4.
D. The program will print the output 100 100.