Sail E0 Webinar

MCQs

Total Questions : 76 | Page 2 of 8 pages
Question 11.

If an array is declared as
int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________


  1.    3, 2
  2.    0, 2
  3.    3, 0
  4.    0, 4
 Discuss Question
Answer: Option C. -> 3, 0



Question 12.

We can output text to an object of class ostream using the insertion operator<< because


  1.    the ostream class is a stream
  2.    the insertion operator works with all classes
  3.    we are actually outputting to cout.
  4.    the insertion operator is overloaded in ostream
 Discuss Question
Answer: Option D. -> the insertion operator is overloaded in ostream



Question 13.

Which of the following cannot be legitimately passed to a function


  1.    A constant.
  2.    A variable.
  3.    A Structure
  4.    A Header File
 Discuss Question
Answer: Option D. -> A Header File



Question 14.

The major goal of inheritance in c++ is:


  1.    To facilitate the conversion of data types.
  2.    To help modular programming.
  3.    To extend the capabilities of a class.
  4.    To hide the details of base class.
 Discuss Question
Answer: Option C. -> To extend the capabilities of a class.



Question 15.

In C++, the range of signed integer type variable is ________


  1.    0 to 216
  2.    -215 to 215 -1
  3.    -27 to 27 -1
  4.    0 to 28
 Discuss Question
Answer: Option B. -> -215 to 215 -1



Question 16.

A white space is :


  1.    blank space
  2.    new line
  3.    tab
  4.    all of the above
 Discuss Question
Answer: Option D. -> all of the above



Question 17.

Usually a pure virtual function


  1.    has complete function body
  2.    will never be called.
  3.    will be called only to delete an object.
  4.    is defined only in derived class.
 Discuss Question
Answer: Option D. -> is defined only in derived class.



Question 18.

An exception is caused by


  1.    a hardware problem
  2.    a problem in the operating system
  3.    a syntax error
  4.    a run-time error
 Discuss Question
Answer: Option D. -> a run-time error


Question 19.

To perform stream I/O with disk files in C++, you should


  1.    open and close files as in procedural languages.
  2.    use classes derived from ios.
  3.    use C language library functions to read and write data.
  4.    include the IOSTREAM.H header file.
 Discuss Question
Answer: Option B. -> use classes derived from ios.



Question 20.

A copy constructor takes


  1.    no argument
  2.    one argument
  3.    two arguments
  4.    arbitrary no. of arguments
 Discuss Question
Answer: Option B. -> one argument



Latest Videos

Latest Test Papers