Sail E0 Webinar

MCQs

Total Questions : 76 | Page 8 of 8 pages
Question 71.

If a base class destructor is not virtual, then


  1.    It can not have a function body.
  2.    It can not be called.
  3.    It can not be called when accessed from pointer.
  4.    Destructor in derived class can not be called when accessed through a pointer to the base class.
 Discuss Question
Answer: Option D. -> Destructor in derived class can not be called when accessed through a pointer to the base class.



Question 72.

Which of the following will produce a value 10 if x = 9.7?


  1.    floor(x)
  2.    abs(x)
  3.    log(x)
  4.    ceil(x)
 Discuss Question
Answer: Option D. -> ceil(x)



Question 73.

What would be the output of the following?
#include<iostream.h>
void main()
{
char *ptr=“abcd”
char ch;
ch = ++*ptr++;

cout<<ch;
}


  1.    a
  2.    b
  3.    c
  4.    d
 Discuss Question
Answer: Option B. -> b



Question 74.

What will be the values of x, m and n after the execution of the following statements?
int x, m, n;
m = 10;
n = 15;
x = ++m + n++;


  1.    x=25, m=10, n=15
  2.    x=26, m=11, n=16
  3.    x=27, m=11, n=16
  4.    x=27, m=10, n=15
 Discuss Question
Answer: Option B. -> x=26, m=11, n=16



Question 75.

Which statement gets affected when i++ is changed to ++i?


  1.    i = 20; i++;
  2.    for (i = 0; i
  3.    a = i++;
  4.    while (i++ = 20) cout
 Discuss Question
Answer: Option A. -> i = 20; i++;


Question 76.

Which of the following operator can be overloaded through friend function?


  1.    ->
  2.    =
  3.    ()
  4.    *
 Discuss Question
Answer: Option D. -> *


Latest Videos

Latest Test Papers