16. 

What will be the output of the following program?

#include<iostream.h> 
class A
{
    public:
    void BixFunction(void)
    {
        cout<< "Class A" << endl;
    }
};
class B: public A
{
    public:
    void BixFunction(void)
    {
        cout<< "Class B" << endl;
    } 
};
class C : public B
{
    public:
    void BixFunction(void)
    {
        cout<< "Class C" << endl;
    } 
};
int main()
{
    A *ptr;
    B objB;
    ptr = &objB;
    ptr = new C();
    ptr->BixFunction();
    return 0; 
}

A. Class A.
B. Class B.
C. Class C.
D. The program will report compile time error.

17. 

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

#include<iostream.h> 
class BixBase
{
    int x, y; 
    public:
    BixBase(int xx = 10, int yy = 10)
    {
        x = xx;
        y = yy;
    }
    void Show()
    {
        cout<< x * y << endl;
    }
};
class BixDerived : public BixBase
{
    private:
        BixBase objBase; 
    public:
    BixDerived(int xx, int yy) : BixBase(xx, yy), objBase(yy, yy)
    {
        objBase.Show();
    }
};
int main()
{
    BixDerived objDev(10, 20);
    return 0; 
}

A. The program will print the output 100.
B. The program will print the output 200.
C. The program will print the output 400.
D. The program will print the output Garbage-value.
E. The program will report compile time error.

18. 

What will be the output of the following program?

#include<iostream.h> 
class Point
{
    int x, y; 
    public:
    Point(int xx = 10, int yy = 20)
    {
        x = xx;
        y = yy; 
    }
    Point operator + (Point objPoint)
    {
        Point objTmp;
        objTmp.x = objPoint.x + this->x; 
        objTmp.y = objPoint.y + this->y;
        return objTmp;
    }
    void Display(void)
    {
        cout<< x << " " << y;
    }
};
int main()
{
    Point objP1;
    Point objP2(1, 2);
    Point objP3 = objP1 + objP2;
    objP3.Display(); 
    return 0; 
}

A. 1 2
B. 10 20
C. 11 22
D. Garbage Garbage
E. The program will report compile time error.

19. 

What will be the output of the following program?

#include<iostream.h>
#include<string.h> 
class IndiaBix
{
    char str[50]; 
    char tmp[50]; 
    public:
    IndiaBix(char *s)
    {
        strcpy(str, s);
    }
    int BixFunction()
    {
        int i = 0, j = 0; 
        while(*(str + i))
        {
            if(*(str + i++) == ' ')
                *(tmp + j++) = *(str + i);
        }
        *(tmp + j) = 0; 
        return strlen(tmp); 
    }
};
int main()
{
    char txt[] = "Welcome to IndiaBix.com!";
    IndiaBix objBix(txt); 
    cout<< objBix.BixFunction();
    return 0;
}

A. 1
B. 2
C. 24
D. 25