Q.1

Which of the following statement is correct?

  • An array of references is acceptable.
  • Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
  • An array of references is not acceptable.
  • Reference is like a structure.
Q.2

Which of the following statement is correct?

  • A reference is stored on heap.
  • A reference is stored on stack.
  • A reference is stored in a queue.
  • A reference is stored in a binary tree.
Q.3

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

#include<iostream.h> 
class Bix
{
    int x, y; 
    public:
    Bix(int x, int y)
    {
        this->x = x;
        this->y = y;
    }
    void Display()
    {
        cout<< x << " " << y;
    }
};
int main()
{
    int x =    int &y = x ;
    Bix b(y, x);
    return
}
  • The program will print the output 50 50.
  • The program will print the two garbage values.
  • It will result in a compile time error.
  • The program will print nothing.
Q.4

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

#include<iostream.h> 
int main()
{
    int x =y =    int *ptr = &x;
    int &ref = y;

    *ptr++;
     ref++;    

    cout<< x << " " << y;
    return
}
  • The program will print the output 10 20.
  • The program will print the output 10 21.
  • The program will print the output 11 20.
  • The program will print the output 11 21.
  • It will result in a compile time error.
Q.5

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

#include<iostream.h> 
int i, j; 
class IndiaBix
{
    public:
    IndiaBix(int x =int y =    {
        i = x; 
        j = x; 
        Display();
    }
    void Display()
    {
        cout<< j <<" ";
    } 
}; 
int main()
{
    IndiaBix objBix(20); 
    int &s = i; 
    int &z = j; 
    i++;
    cout<< s-- << " " << ++z; 
    return
}
  • The program will print the output 0 11 21.
  • The program will print the output 10 11 11.
  • The program will print the output 10 11 21.
  • The program will print the output 10 11 12.
  • It will result in a compile time error.
Q.6

Which of the following statements is correct?

  1. Pointer to a reference and reference to a pointer both are valid.
  2. When we use reference, we are actually referring to a referent.
  • Only 1 is correct.
  • Only 2 is correct.
  • Both 1 and 2 are correct.
  • Both 1 and 2 are incorrect.
Q.7

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

#include<iostream.h> 
enum xyz
{
    a, b, c
};
int main() 
{
    int x = a, y = b, z = c;
    int &p = x, &q = y, &r = z;
    p = ++x;
    q = ++y;
    r = ++c;
    cout<< p << q << r;
    return}
  • The program will print the output 1 2 3.
  • The program will print the output 2 3 4.
  • The program will print the output 0 1 2.
  • It will result in a compile time error.
Q.8

Which of the following statements is correct?

  1. Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
  2. A reference is not a constant pointer.
  • Only 1 is correct.
  • Only 2 is correct.
  • Both 1 and 2 are correct.
  • Both 1 and 2 are incorrect.
Q.9

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

#include<iostream.h> 
int main()
{
    int x =
    int y& = x;
    x++;
    cout << x << " " << --y;
    return}
  • The program will print the output 80 80.
  • The program will print the output 81 80.
  • The program will print the output 81 81.
  • It will result in a compile time error.
Q.10

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

#include<iostream.h> 
int main()
{
    int m =n =    int &x = m;
    int &y = n;
    m = x++; 
    x = m++;
    n = y++;
    y = n++;
    cout<< m << " " << n; 
    return
}
  • The program will print output 2 6.
  • The program will print output 3 7.
  • The program will print output 4 8.
  • The program will print output 5 9.
  • The program will print output 6 10.
Q.11

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

#include<iostream.h> 
class IndiaBix
{
    int x, y; 
    public:
    void SetValue(int &xx, int &yy)
    {
        x =  xx++;
        y =  yy; 
        cout<< xx << " " << yy;
    }
};
int main()
{
    int x =    int &y = x;
    IndiaBix objBix;
    objBix.SetValue(x , y);
    return
}
  • The program will print the output 10 10.
  • The program will print the output 10 11.
  • The program will print the output 11 10.
  • The program will print the output 11 11.
  • It will result in a compile time error.
Q.12

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

#include<iostream.h> 
int main()
{
    int x =    int &y = x; y =
    while(x <=    {
        cout<< y++ << " ";
        x++;
    }
    cout<< x; 
    return
}
  • The program will print the output 5 6 7 8 9 10.
  • The program will print the output 5 6 7 8 9 10 7.
  • The program will print the output 5 7.
  • It will result in a compile time error.
Q.13

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

#include<iostream.h> 
int x, y; 
class BixTest
{
    public:
    BixTest(int xx =int yy =    {
        x = xx;
        y = yy;
        Display(); 
    } 
    void Display()
    {
        cout<< x << " " << y << " ";
    }
};
int main()
{
    BixTest objBT(20); 
    int &rx = x; 
    int &ry = y; 
    ry = x;
    rx = y;
    cout<< rx--; 
    return
}
  • The program will print the output 0 0 10.
  • The program will print the output 10 20 10.
  • The program will print the output 10 20 9.
  • It will result in a compile time error.
Q.14

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

#include<iostream.h> 
int main()
{
    int arr[] = {2 ,5}; 
    int &zarr = arr;
    for(int i =i <=i++)
    {
        arr[i] += arr[i];
    }
    for(i =i <=i++)
        cout<< zarr[i]; 
    return
}
  • The program will print the output 1 2 3 4 5.
  • The program will print the output 2 4 6 8 10.
  • The program will print the output 1 1 1 1 1.
  • It will result in a compile time error.
Q.15

A reference is declared using the _____ symbol.

  • &&
  • &
  • ||
  • !
Q.16

Functions can be declared to return a reference type. There are reasons to make such a declaration/Which of the following reasons are correct?

  1. The information being returned is a large enough object that returning a reference is more efficient than returning a copy.
  2. The type of the function must be a R-value.
  • Only 1 is correct.
  • Only 2 is correct.
  • Both 1 and 2 are correct.
  • Both 1 and 2 are incorrect.
Q.17

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

#include<iostream.h> 
int main()
{
    int x =
    int &y = x;
    x++;
    cout << x << " " << --y;
    return}
  • The program will print the output 80 80.
  • The program will print the output 81 80.
  • The program will print the output 81 81.
  • It will result in a compile time error.
Q.18

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

#include<iostream.h> 
class IndiaBix
{
    int x, y; 
    public:
    void SetValue(int &a, int &b)
    {
        a =        x = a;
        y = b;
        Display();
    }
    void Display()
    {
        cout<< x << " " << y; 
    }
};
int main()
{
    int x =    IndiaBix objBix;
    objBix.SetValue(x, x);
    return}
  • The program will print the output 100 10.
  • The program will print the output 100 100.
  • The program will print the output 100 garbage.
  • The program will print two garbage values.
  • It will result in a compile time error.
Q.19

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

#include<iostream.h> 
int main()
{
    int m =n =    int &x = m++;
    int &y = n++;
    m = x++; 
    x = m++;
    n = y++;
    y = n++;
    cout<< m << " " << n; 
    return
}
  • The program will print output 3 7.
  • The program will print output 4 8.
  • The program will print output 5 9.
  • The program will print output 6 10.
  • It will result in a compile time error.
Q.20

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  =    int &y = x;
    y =    objBix.SetValue(x, ++y, x + y);
    objBix.Display();
    return
}
  • The program will print the output 5 6 10.
  • The program will print the output 6 6 10.
  • The program will print the output 6 6 12.
  • It will result in a compile time error.
0 h : 0 m : 1 s