CPP

CPP

References has 5 Questions

Which value we cannot assign to reference?

integer
floating
unsigned
null
Identify the incorrect statement

reference is the alternate name of the object
A reference value once defined can be reassigned
A reference value once defined cannot be reassigned
none of the mentioned
Which reference modifier is used to define reference variable?

&
$
#
none of the mentioned
What is the output of this program?
  1.     #include 
  2.     using namespace std;
  3.     void swap(int &a, int &b);
  4.     int main()
  5.     {
  6.         int a = 5, b = 10;
  7.         swap(a, b);
  8.         cout << "In main " << a << b;
  9.         return 0;
  10.     }
  11.     void swap(int &a, int &b)
  12.     {
  13.         int temp;
  14.         temp = a;
  15.         a = b;
  16.         b = temp;
  17.         cout << "In swap " << a << b;
  18.     }

In swap 105 In main 105
In swap 105 In main 510
In swap 510 In main 105
none of the mentioned
Identify the correct sentence regarding inequality between reference and pointer.

we can not create the array of reference.
we can create the Array of reference.
we can use reference to reference.
none of the mentioned