Sail E0 Webinar

MCQs

Total Questions : 37 | Page 3 of 4 pages
Question 21.

Which of the following statement is correct?


  1.    A reference is a constant pointer.
  2.    A reference is not a constant pointer.
  3.    An array of references is acceptable.
  4.    It is possible to create a reference to a reference.
 Discuss Question
Answer: Option A. -> A reference is a constant pointer.


Question 22.

Reference is like a _____.


  1.    Pointer
  2.    Structure
  3.    Macro
  4.    Enum
 Discuss Question
Answer: Option A. -> Pointer


Question 23.

Which of the following statement is correct?


  1.    A referenced has to be de-referenced to access a value.
  2.    A referenced does not need to be de-referenced to access a value.
  3.    A referenced has to be double de-referenced to access a value.
  4.    Whether a reference should be de-referenced or not depends on the type of the reference.
 Discuss Question
Answer: Option B. -> A referenced does not need to be de-referenced to access a value.


Question 24.

Which of the following statements is correct?

      1. We can return a global variable by reference.

      2. We cannot return a local variable by reference.


  1.    Only 1 is correct.
  2.    Only 2 is correct.
  3.    Both 1 and 2 are correct.
  4.    Both 1 and 2 are incorrect.
 Discuss Question
Answer: Option B. -> Only 2 is correct.


Question 25.

Which of the following statements is correct?

       1. Once the variable and the reference are linked they are tied together.

       2. Once the reference of a variable is declared another reference of that variable is not allowed.


  1.    Only 1 is correct.
  2.    Only 2 is correct.
  3.    Both 1 and 2 are correct.
  4.    Both 1 and 2 are incorrect.
 Discuss Question
Answer: Option A. -> Only 1 is correct.


Question 26.

Which of the following statements is correct?

      1. An array of references is acceptable. 

      2. We can also create a reference to a reference.


  1.    Only 1 is correct.
  2.    Only 2 is correct.
  3.    Both 1 and 2 are correct.
  4.    Both 1 and 2 are incorrect.
 Discuss Question
Answer: Option D. -> Both 1 and 2 are incorrect.


Question 27.

Which of the following statement 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 indicated by using && operator.
  3.    Once a reference variable has been defined to refer to a particular variable it cannot refer to any other variable.
  4.    A reference can be declared beforehand and initialized later.
 Discuss Question
Answer: Option C. -> Once a reference variable has been defined to refer to a particular variable it cannot refer to any other variable.


Question 28.

Which of the following statement is correct about the references?


  1.    A reference must always be initialized within functions.
  2.    A reference must always be initialized outside all functions.
  3.    A reference must always be initialized.
  4.    Both A and C.
 Discuss Question
Answer: Option C. -> A reference must always be initialized.


Question 29.

Which of the following statements is correct?

      1. A reference is not a constant pointer.

      2. A referenced is automatically de-referenced.


  1.    Only 1 is correct.
  2.    Only 2 is correct.
  3.    Both 1 and 2 are correct.
  4.    Both 1 and 2 are incorrect.
 Discuss Question
Answer: Option B. -> Only 2 is correct.


Question 30.

A reference is declared using the _____ symbol.


  1.    &&
  2.    &
  3.    ||
  4.    !
 Discuss Question
Answer: Option B. -> &


Latest Videos

Latest Test Papers