31. 

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

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

A. The program will print the output 1 0 3.
B. The program will print the output 1 0 4.
C. The program will print the output 1 1 3.
D. The program will print the output 1 1 4.
E. The program will report compile time error.

32. 

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

#include<iostream.h> 
class BixArray
{
    int array[3][3];
    public:
    BixArray(int arr[3][3] = NULL)
    { 
        if(arr != NULL)
        for(int i = 0; i < 3; i++) 
            for(int j = 0; j < 3; j++) 
                array[i][j] = i+j; 
    } 
    void Display(void)
    {
        for(int i = 0; i < 3; i++) 
            for(int j = 0; j < 3; j++)
                cout<< array[i][j] << " "; 
    }
};
int main()
{
    BixArray objBA;
    objBA.Display();
    return 0; 
}

A. The program will report error on compilation.
B. The program will display 9 garbage values.
C. The program will display NULL 9 times.
D. The program will display 0 1 2 1 2 3 2 3 4.

33. 

What will be the output of the following program?

#include<iostream.h> 
struct IndiaBix
{
    int arr[5]; 
    public:
    void BixFunction(void);
    void Display(void);
};
void IndiaBix::Display(void)
{
    for(int i = 0; i < 5; i++) 
        cout<< arr[i] << " " ;
}
void IndiaBix::BixFunction(void)
{
    static int i = 0, j = 4; 
    int tmp = arr[i]; 
    arr[i]  = arr[j]; 
    arr[j]  = tmp   ; 
    i++;
    j--;
    if(j != i) BixFunction();
}
int main()
{
    IndiaBix objBix = {{ 5, 6, 3, 9, 0 }};
    objBix.BixFunction();
    objBix.Display();
    return 0; 
}

A. 0 9 3 6 5
B. 9 3 6 5 0
C. 5 6 3 9 0
D. 5 9 3 6 0

34. 

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

#include<iostream.h> 
class IndiaBix
{
    int x; 
    float y; 
    public:
    IndiaBix(int x)
    {
        x = x;
    }
    IndiaBix(int p = 0, int q = 10)
    {
        x = p += 2; 
        y = q * 1.0f;
    }
    void SetValue(int &y, float z)
    {
        x = y;
        y = (int)z;
    }
    void Display(void)
    {
        cout<< x;
    }
};
int main()
{
    int val = 12; 
    IndiaBix objBix(val); 
    IndiaBix objTmp();
    objBix.SetValue(val, 3.14f); 
    objBix.Display(); 
    return 0; 
}

A. The program will print the output 2.
B. The program will print the output 12.
C. The program will report run time error.
D. The program will not compile successfully.

35. 

What will be the output of the following program?

#include<iostream.h> 
struct BixArray
{
    int arr[5]; 
    public:
    void BixFunction();
    void Display();
};
void BixArray::BixFunction()
{
    static int i = 0, j = 4; 
    i++;
    j--;
    if(j > 0)
        BixFunction(); 
    int tmp = arr[i]; 
    arr[i]  = arr[j]; 
    arr[j]  = tmp; 
    i--;
    j++;
}
void BixArray::Display()
{
    for(int i = 0; i < 5; i++)
        cout<< arr[i] << " ";
} 
int main()
{
    BixArray objArr = {{5, 6, 3, 9, 0}};
    objArr.BixFunction();
    objArr.Display();
    return 0; 
}

A. 5 6 3 9 0
B. 0 9 3 6 5
C. 0 5 6 3 9
D. 0 6 3 9 5
E. None of these