Sail E0 Webinar

MCQs

Total Questions : 76 | Page 3 of 8 pages
Question 21.

The process of building new classes from existing one is called ______.


  1.    Polymorphism
  2.    Structure
  3.    Inheritance
  4.    Cascading
 Discuss Question
Answer: Option C. -> Inheritance


Question 22.

If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access


  1.    protected and public data only in C and B.
  2.    protected and public data only in C.
  3.    private data in A and B.
  4.    protected data in A and B.
 Discuss Question
Answer: Option D. -> protected data in A and B.



Question 23.

In C++, dynamic memory allocation is accomplished with the operator ____


  1.    new
  2.    this
  3.    malloc()
  4.    delete
 Discuss Question
Answer: Option A. -> new


Question 24.

The operator that cannot be overloaded is


  1.    ++
  2.    ::
  3.    ()
  4.    ~
 Discuss Question
Answer: Option B. -> ::



Question 25.

What is the output of the following code



char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol[index];


  1.    a b c
  2.    â€œabc”
  3.    abc
  4.    â€˜abc’
 Discuss Question
Answer: Option C. -> abc



Question 26.

A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is __________


  1.    call by name
  2.    call by value
  3.    call by reference
  4.    call by value result
 Discuss Question
Answer: Option B. -> call by value



Question 27.

Which of the following statement is valid?


  1.    We can create new C++ operators.
  2.    We can change the precedence of the C++ operators.
  3.    We can change the associativity of the C++ operators.
  4.    We can not change operator templates.
 Discuss Question
Answer: Option D. -> We can not change operator templates.



Question 28.

You can read input that consists of multiple lines of text using


  1.    the normal cout
  2.    the cin.get( ) function with one argument
  3.    the cin.get( ) function with two arguments.
  4.    the cin.get( ) function with three arguments.
 Discuss Question
Answer: Option C. -> the cin.get( ) function with two arguments.



Question 29.

What will be the output of following program?
#include<iostream.h>
void main()
{
float x;
x=(float)9/2;
cout<<x;
}


  1.    4.5
  2.    4.0
  3.    4
  4.    5
 Discuss Question
Answer: Option A. -> 4.5


Question 30.

RunTime polymorphism is achieved by ___________


  1.    friend function
  2.    virtual function
  3.    operator overloading
  4.    function overloading
 Discuss Question
Answer: Option B. -> virtual function



Latest Videos

Latest Test Papers