Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C++ - QUESTIONS : PART 2

Which of the following statements is correct?

Base class pointer cannot point to derived class.

Derived class pointer cannot point to base class.

Pointer to derived class cannot be created.

Pointer to base class cannot be created.

SHOW ANSWER

Which of the following is not the member of class?

Static function

Friend function

Const function

Virtual function

SHOW ANSWER

Which of the following term is used for a function defined inside a class?

Member Variable

Member function

Class function

Classic function

SHOW ANSWER

Which of the following statement is correct?

A constructor is called at the time of declaration of an object.

A constructor is called at the time of use of an object.

A constructor is called at the time of declaration of a class.

A constructor is called at the time of use of a class.

SHOW ANSWER

Which of the following approach is adapted by C++?

Top-down

Bottom-up

Right-left

Left-right

SHOW ANSWER

Which of the following operator is overloaded for object cout?

>>

<<

+

=

SHOW ANSWER

Which of the following functions are performed by a constructor?

Construct a new class

Construct a new object

Construct a new function

Initialize objects

SHOW ANSWER

When a function is defined inside a class, this function is called ………….

Inside function

 Class function

Inline function

 Interior function
SHOW ANSWER

Which of the following cannot be passed to a function?

Reference variable

 Arrays

 Class objects

Header files
SHOW ANSWER

State true of false.
i) We cannot make the function inline by defining a function outside the class.
ii) A member function can be called by using its name inside another member function of the same class, this is known as nesting of member function.

True, True


True, False

False, True

 False, False
SHOW ANSWER

Which of the following operators could be overloaded?

Size of

 +

 +=

 ::
SHOW ANSWER

Which of the following keywords are used to control access to a class member?

default

break

protected

 goto
SHOW ANSWER

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

x=25, m=10, n=15

 x=27, m=10, n=15

 x=26, m=11, n=16

x=27, m=11, n=16
SHOW ANSWER

The major goal of inheritance in C++ is

To facilitate the conversion of data types

 To help modular programming

 To facilitate the re usability of code

 To extend the capabilities of a class
SHOW ANSWER

A variable is defined within a block in a body of a function. Which of the following are true?

It is visible throughout the function.

 It is visible from the point of definition to the end of the program.

 It is visible from the point of definition to the end of the block.

 It is visible throughout the block.
SHOW ANSWER

The friend functions are used in situations where

We want to exchange data between classes

 We want to have access to unrelated classes

 Dynamic binding is required

 We want to create versatile overloaded operators.
SHOW ANSWER

 ………….. means that the code associated with a given procedure call is not known until the time of the call at run time.

 dynamic binding

 run time binding

 early binding

static binding
SHOW ANSWER

Through ………………., we can eliminate redundant code and extend the use of existing classes.

Encapsulation

 Polymorphism

 Inheritance

 Overloading
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in