You are on page 1of 54

1. C++ is an extension of C with a major addition of the class construct feature of ……………..

A) Simula67

B) Simula57

C) Simula47

D) Simula87

2. C++ has the name ………………….. before it was changed to C++.

A) Improved C

B) Integrated C

C) C with classes

D) C with Simula

3. …………. Refer to the names of variables, functions, arrays, classes etc. created by the programmer.

A) Keywords

B) Identifiers

C) Constraints

D) Strings

4. In C++, the keyword void was used ………..

A) To specify the return type of function when it is not returning any value.

B) To indicate an empty argument list to a function.

C) To declare the generic pointers.

D) All of the above.

5. Match the following

a) : : i) Pointer to member declarator

b) : :* ii) Pointer to member operator


c) ->* iii) Scope resolution operator

A) a-ii, b-iii, c-i

B) a-iii, b-i, c-ii

C) a-i b-ii, c-iii

D) a-iii, b-ii, c-i

6. If m and n are int type variables, what will be the result of the expression

m% n when m=5 and n=2 ?

A) 0

B) 1

C) 2

D) None of the above

7. Some of the C++ operators cannot overloaded which are

i) Member access operators (. And .*) ii) Conditional operator (? 🙂

iii) Scope resolution operator (: 🙂 iv) Size operator (sizeof)

A) only i, ii and iii

B) only ii, iii and iv

C) only ii and iv

D) All i, ii, iii and iv

8. Some of the situations where inline expansion may not work are:

A) For functions returning values, if a loop, a switch or goto exists.

B) If functions contain static variables and they are re-cursive.

C) For functions not returning values, if return statement exist.

D) All of the above.


9. Which of the following control expressions are valid for an if statement?

A) an integer expression

B) a Boolean expression

C) either A or B

D) Neither A nor B

10. …………… is a way to bind the data and its associated functions together which allows the data and
functions to be hidden.

A) Structure

B) Class

C) Enum

D) Both A and B

11. Procedure oriented programming basically consists of writing a list of insturctions or actions for the
computer to follow and organizing these instructions into groups known as ………………

A) procedures

B) functions

C) flowchart

D) instructions

12. State whether the following statements are true about object oriented programming in C++.

i) Data is hidden and cannot be accessed by external functions.

ii) Follows top-bottom approach in program design.

iii) Objects may communicate with each other through functions.

A) True, True, False

B) False, True, False

C) True, False, True

D) False, True, True


13. The wrapping up of data and functions into a single unit is known as ……………..

A) abstraction

B) inheritance

C) polymorphism

D) encapsulation

14. ……………… refers to the act of representing essential features without including the background
details or explanations.

A) abstraction

B) inheritance

C) polymorphism

D) encapsulation

15. ……………. is the process by which objects of one class acquire the properties of objects of another
class.

A) abstraction

B) inheritance

C) polymorphism

D) encapsulation

16. The ……………. Operator is known as insertion operator.

A) >>

B) >

C) <<

D) <
17. State True or False.

i) A satic function can have access to only other static members (functions or variables) declared in the
same class.

ii) A static member function can be called using the class name (instead of its objects)

A) True, True

B) True, False

C) False, True

D) False, False

18. Which of the following condition is true for an object used as a function argument?

i) A copy of the entire objects is passed to the function.

ii) Only the address of the object is transferred to the function.

A) Only i

B) Only ii

C) Both i and ii

D) None of them

19. …………… enable us to hide, inside the object, both the data fields and the methods that act on that
data.

A) Encapsulation

B) Polymorphism

C) Inheritance

D) Overloading

20. Which of the following is/ are the characteristics of friend function.

A) It is not in the scope of the class to which it has been declared as friend.

B) It can invoke like a normal function without the help of any object.

C) Usually, it has the objects as arguments.

D) All of the above.


21. The dereferencing operator ………….. is used to access a member when we use pointers to both the
object and the member.

A) ->*

B) .*

C) Any of the above

D) None of the above

22. A ………………. Is a class whose instances themselves are classes.

A) Subclass

B) Abstract Class

C) Meta Class

D) Object Class

23. The dereferencing operator ……… is used when the object itself is used width in the member pointer.

A) ->*

B) .*

C) Any of the above

D) None of the above

24. A constructor that accepts no parameters is called the ……………….

A) Paramless constructor

B) No parameter constructor

C) Default constructor

D) Argumentless constructor

25. Automatic initialization of object is carried out using a special member function called …………
A) Friend

B) Casting

C) Reference Parameter

D) Constructor

26. Which of the following characteristics of constructor are true.

i) They should be declared in the public section.

ii) They are invoked automatically when the objects are created.

iii) They do not have return type and void also.

iv) We cannot refer their address.

v) Constructors cannot virtual.

A) Only i, ii, iii and v

B) Only ii, iii, iv, and v

C) Only i, iii, iv and v

D) All i, ii, iii, iv and v

27. A ……………. takes a reference to an object of the same class as itself as an argument.

A) Reference constructor

B) Copy Constructor

C) Self Constructor

D) None of the above

28. State True or False

i) A destructor never takes any argument nor does it return any value.

ii) It releases memory space for future use.

A) True, True

B) True, False

C) False, True

D) False, False
29. Which of the following operates cannot be overloaded?

i) Size of operator (sizeof) ii) Scope resolution Operator

iii) Conditional operator (?:) iv) Assignment Operator (=)

A) i, ii, iii only

B) ii, iii, iv only

C) i, iii, iv only

D) all i, ii, iii, iv

30. …………. Is the process of creating new classes, called derived classes from existing classes called base
class.

A) Inheritance

B) Encapsulation

C) Polymorphism

D) Overloading

31. State True or False.

i) While overloading operators new operator can be overloaded.

ii) The binary operator such as +, -, * and must explicitly return a value.

A) True, True

B) True, False

C) False, True

D) False, False

32. ………… function writes a string of text to a window.

A) cputs ()

B) put ()

C) gets ()

D) tputs ()
33. Which of the following condition (s) should satisfy the casting operator.

i) It must be a class member.

ii) It must not satisfy a return type.

iii) It must have any arguments.

iv) All of the above.

34. Find the Hierarchy of Data Types.

i) Long double ii) Double iii) Float iv) Long v) Int vi) Char

A) 1-2-3-4-5-6

B) 1-3-2-4-5-6

C) 1-2-3-5-4-6

D) 1-2-4-3-5-6

35. ………….. function sets the fill pattern and color.

A) floodfill ()

B) setcolor()

C) setfillstyle()

D) fillstyle ()

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

A) Inside function

B) Class function

C) Inline function

D) Interior function

37. Which of the following cannot be passed to a function?

A) Reference variable

B) Arrays
C) Class objects

D) Header files

38. 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.

A) True, True

B) True, False

C) False, True

D) False, False

39. Which of the following operators could be overloaded?

A) Size of

B) +

C) +=

D) ::

40. Which of the following is true about the static member variable in C++.

i) It is initialized to zero when the first object of its class is created. Other initialization is also permitted.

ii) It is visible only within the class, but its lifetime is the entire program.

A) i-True, ii-True

B) ii-False, ii-True

C) i-True, ii-False

D) i-False, iii-False

41. Which of the following keywords are used to control access to a class member?
A) default

B) break

C) protected

D) goto

42. 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++;

A) x=25, m=10, n=15

B) x=27, m=10, n=15

C) x=26, m=11, n=16

D) x=27, m=11, n=16

43. The major goal of inheritance in C++ is

A) To facilitate the conversion of data types

B) To help modular programming

C) To facilitate the re usability of code

D) To extend the capabilities of a class

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

A) It is visible throughout the function.

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

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

D) It is visible throughout the block.


45. The friend functions are used in situations where

A) We want to exchange data between classes

B) We want to have access to unrelated classes

C) Dynamic binding is required

D) We want to create versatile overloaded operators.

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

A) dynamic binding

B) run time binding

C) early binding

D)static binding

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

A) Encapsulation

B) Polymorphism

C) Inheritance

D) Overloading

48. State whether the following statements about the benefits of OOP are True or False.

i) Software complexity can be easily managed.

ii) It is easy to partition the work in a project based on objects.

A) True, False

B) False, True

C) True, True

D) False, False

49. Major features that are required for object based programming is/are
i) Data encapsulation ii) Data hiding iii) Automatic initialization iv) operator overloading

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv

50. In OOP, a problem is considered as a collection of number of entities called ………………

A) class

B) objects

C) functions

D) message

51. In C++ ………………… operator is used for Dynamic memory allocation.

A) Scope resolution

B) Conditional

C) New

D) Membership access

52. Operators such as …………………. cannot be overloaded.

A) +

B) ++

C) : :

D) = =

53. The …………………. objects have values that can be tested for various error conditions.

A) osstream

B) ofstream
C) stream

D) ifstream

54. Which function return the current position of the get or put pointer in bytes.

A) tellg( )

B) tellp( )

C) tell( )

D) Both A and B

55. The first index number in an array starts with ………………………. and the index number of an array of
size n will be …………

A) 0, n-1

B) 1, n-1

C) 0, n

D) 1, n

56. To overload an operator ………………… keyword must be used along with the operator to be
overloaded.

A) Over

B) Overload

C) Void

D) Operator

57. What is the output of the program

#include<iostream.h>

void main()

{
int n=1;

cout<<endl<<“The numbers are;”<<endl;

do

cout <<n<<“t”;

n++;

} while (n<=100);

cout <<endl;

A) Print natural numbers 0 to 99

B) Print natural numbers 1 to 99

C) Print natural numbers 0 to 100

D) Print natural numbers 1 to 100

58. Everything defined at the program scope level (ie. outside functions and classes) is said to be
……………

A) local scope

B) regional scope

C) global scope

D) static scope

59. Because the lifetime of a local variable is limited and determined automatically, these variables are
also called ……………………….

A) automator

B) automatic

C) dynamic
D) static

60. ……………. allows that a section of a program is compiled only if the defined constant that is specified
as the parameter has been defined, independently of its value.

A) #ifdef

B) #if

C) #define

D) #ifd

61. Which of the following is/are the header files listed in C++ standard library.

i) <ctype.h> ii) <float.h> iii) <date.h> iv) <limits.h>

A) i, ii and iii only

B) i, ii and iv only

C) ii, iii and iv only

D) All i, ii, iii and iv

62. The C++ header file …………….. contains macros and information for adding diagnostics that aid
program debugging.

A) <cctype>

B) <cassert>

C) <cfloat>

D) <cstdio>

63. …………… is the header file that contains functions prototypes and types for manipulating the time
and date.

A) <ctype.h>

B) <float.h>

C) <time.h>

D) <date.h>
64. The C++ header file ……………….. contains function prototypes for the standard input and standard
output functions.

A) <iomanip>

B) <fstream>

C) <iostream>

D) <cstdio>

65. ……………. is the header file listed in C++ standard library that contains function prototypes for the
stream manipulators that enable formatting of streams of data.

A) <iomanip>

B) <fstream>

C) <iostream>

D) <cstdio>

66. 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.

A) Protected and public data only in C and B

B) Protected and public data only in C

C) Private data in A and B

D) Protected data in A and B

67. Overloading the function operator

A) requires a class with an overloaded operator

B) requires a class with an overloaded [ ] operator.

C) allows you to create objects that act syntactically like functions.

D) usually make use of a constructor that takes arguments.

68. What is a constructor?

A) A function called when an instance of a class is initialized.

B) A function that is called when an instance of a class is deleted;


C) A special function to change the value of dynamically allocated memory

D) A function that is called in order to change the value of a variable.

69. Mechanism of deriving a class from another derived class is known as ………

A) Polymorphism

B) Single Inheritance

C) Multilevel Inheritance

D) Message Passing

70. RunTime Polymorphism is achieved by ……….

A) friend function

B) virtual function

C) operator overloading

D) function overloading

71. Which of the following is the proper declaration of a pointer?

A) int x;

B) int &x;

C) ptr x;

D) int *x;

72. In multiple inheritance

A) the base classes must have only default constructors

B) cannot have virtual functions

C) can include virtual classes

D) None of the above


73. for (;

A) means the test which is done using some expression is always true

B) is not valid

C) will loop forever

D) should be written as for( )

74. The compilers converts all operands upto to type of the largest operand is called as …………

A) typeconversion

B) expression

C) evaluation

D) precedence

75. The keyword FRIEND does not appear in

A) the class allowing access to another class

B) the class desiring access to another class

C) the private section of a class

D) the public section of a class

76. What is required in inheritance to initialize the data members of the base class through derived
class?

A) Object declaration

B) Destructor

C) Constructor

D) Inheritance
77. In which case is it mandatory to provide a destructor in a class?

A) Almost in every class

B) Class for which two or more than two objects will be created

C) Class for which copy constructor is defined

D) Class whose objects will be created dynamically

78. Which of the statements is true in a protected derivation of a derived class from a base class?

A) Private members of the base class become protected members of the derived class

B) Protected members of the base class become public members of the derived class

C) Public members of the base class become protected members of the derived class

D) Protected derivation does not affect private and protected members of the derived class

79. When the access specifier of the base class in the derived class definition is public, the base class is ..

A) Publicly inherited

B) Protectively inherited

C) Privately inherited

D) None of the above

80. A pointer to the base class can hold address of

A) only base class object

B) only derived class object

C) base class object as well as derived class object

D) None of the above

81. A template class


A) is designed to be stored in different containers

B) works with different data types

C) generates objects which must be identical

D) generates classes with different numbers functions

82. The constructor and the destructor of a class are automatically invoked when memory is allocated
and deallocated to an ….

A) Data type

B) Copy constructor

C) Object

D) None of the above

83. A pure virtual function is a virtual function that

A) has no body

B) returns nothing

C) is used in base class

D) both (A) and (C)

84. A class defined within another class is

A) Nested Class

B) Inheritance

C) Containership

D) Encapsulation

85. Which variable stores the memory address of another variable?


A) Reference

B) Pointer

C) Array

D) None of the above

86. In compile time polymorphism, compiler is able to select the appropriate function for a particular
call at the compile time itself, which is known as …………

A) early binding

B) static binding

C) static linking

D) All of the above

87. ……………. binding means that, an object is bound to its function call at compile time.

A) late

B) static

C) dynamic

D) fixed

88. C++ supports run time polymorphism with the help of virtual functions, which is called ……………..
binding.

A) dynamic

B) run time

C) early binding

D)static

89. State whether the following statements about pointers in C++ are True.
i) A pointer can be incremented (++) or decremented (–)

ii) Any integer can be added to or subtracted from a pointer

iii) One pointer can be subtracted from another

A) i and ii only

B) ii and iii only

C) i and iii only

D) All i, ii and iii

90. ………………. are also known as generic pointers, which refer to variables of any type.

A) void pointers

B) null pointers

C) this pointer

D) base pointer

91. The pointers which are not initialized in a program are called ……………..

A) void pointers

B) null pointers

C) this pointer

D) base pointer

92. …………………… is useful in creating objects at run time.

A) void pointer

B) null pointer

C) this pointer

D) object pointer

93. A …………………. refers to an object that that currently invokes a member function.
A) void pointers

B) null pointers

C) this pointer

D) base pointer

94. The …………………. cannot be directly used to access all the members of the derived class.

A) void pointers

B) null pointers

C) this pointer

D) base pointer

95. Run time polymorphism is achieved only when a ……………….. is accessed through a pointer to the
base class.

A) member function

B) virtual function

C) static function

D) real function

96. If a ……………………… is defined in the base class, it need not be necessarily redefined in the derived
class.

A) member function

B) virtual function

C) static function

D) real function

97. …………………………. is a function declared in a base class that has no definition relative to the base
class.

A) member function

B) virtual function
C) pure virtual function

D) pure function

98. State whether the following statements about virtual functions are True or False.

i) A virtual function, equated to zero is called pure virtual function.

ii) A class containing pure virtual function is called an abstract class

A) True, True

B) True, False

C) False, True

D) False, False

99. The main objective of an abstract base class is to provide some traits to the derived class and to
create a ………………………. required for achieving run time polymorphism.

A) void pointers

B) null pointers

C) this pointer

D) base pointer

100. State whether the following statements about virtual functions is/are True.

i) The virtual function must be member of some class

ii) virtual functions cannot be static members

iii) A virtual function can not be a friend of another class.

A) i and ii only

B) ii and iii only

C) i and iii only

D) All i, ii and iii

101. The important application of ………………… is to return the object it points to.

A) void pointers
B) null pointers

C) this pointer

D) base pointer

102. The pointer to function is known as …………………. function.

A) forward

B) pointer

C) callback

D) backward

103. We can manipulate a pointer with the indirection operator (*), which is also known as
……………………

A) reference operator

B) dereference operator

C) direction operator

D) indirection operator

104. Using the ………………………., we can change the contents of the memory location.

A) reference operator

B) dereference operator

C) direction operator

D) indirection operator

105. If we attempt to dereference an uninitialized pointer, it will ………………….. by referring to any other
location in memory.

A) cause compile time error

B) run time error

C) cause run time error

D) executes
106. The ……………. inherits some or all of the properties of the ……….. class.

A) base, derived

B) derived, base

C) derived, initial

D) base, final

107. A derived class with only one base class is called …………… inheritance.

A) single

B) multiple

C) multilevel

D) hierarchical

108. A class can inherit properties from more than one class which is known as ……….inheritance.

A) single

B) multiple

C) multilevel

D) hierarchical

109. A class can be derived from another derived class which is known as ………. inheritance.

A) single

B) multiple

C) multilevel

D) hierarchical

110. When the properties of one class are inherited by more than one class, which is called ………
inheritance.
A) single

B) multiple

C) multilevel

D) hierarchical

111. When a base class is privately inherited by a derived class public members of the base class become
………. of the derived class.

A) private members

B) protected members

C) Public members

D) Not inherited

112. When a base class is privately inherited by a derived class public members of the base class can
only be accessed by the ……… of the derived class.

A) non-member functions

B) friend functions

C) member functions

D) class members

113. When a protected member is inherited in public mode, it becomes ……….. in the derived class too
and therefore is accessible by member functions of the derived class.

A) protected

B) private

C) public

D) friend

114. State whether the following statements about inheritance are True or False.

i) A public member of a class can be accessed by its own objects using the dot operator.
ii) While inheriting, the private members of the base class will never become the members of its derived
class.

A) True, False

B) False, True

C) True, True

D) False, False

115. A member declared as ………….. is accessible by the member functions within its class and any class
immediately derived from it.

A) protected

B) private

C) public

D) friend

116. When the base class is publicly inherited, public members of the base class become …………. of the
derived class.

A) private members

B) protected members

C) Public members

D) Not inherited

117. In protected derivation, both the public and protected members of the base class become ………….
members of the derived class.

A) protected

B) private

C) public

D) friend
118. What will be the order of execution of base class constructors in the following method of
inheritance.

class A: public B, public C {….};

A) B(); C(); A();

B) C(); B(); A();

C) A(); B(); C();

D) B(); A(); C();

119. What will be the order of execution of base class constructors in the following method of
inheritance.

class A: public B, virtual public C {….};

A) B(); C(); A();

B) C(); B(); A();

C) A(); B(); C();

D) B(); A(); C();

120. While the friend functions and the member functions of a friend class can have direct access to
both the private and protected data, the member functions of a derived class can directly access only
the ………… data.

A) protected

B) private

C) public

D) friend

121. In ……………………. inheritance, the constructors are executed in the order of inheritance.

A) multipath

B) multiple

C) multilevel

D) hierarchical
122. In ……………….. inheritance, the base classes are constructed in the order in which they appear in the
deceleration of the derived class.

A) multipath

B) multiple

C) multilevel

D) hierarchical

123. ……………….. inheritance may lead to duplication of inherited members from a ‘grandparent’ base
class.

A) multipath

B) multiple

C) multilevel

D) hierarchical

124. The member functions of a derived class can directly access only the ……………….. data.

A) private and protected

B) private and public

C) protected and public

D) private, protected and public

125. The friend functions and the member functions of a friend class can directly access the ……………….
data.

A) private and protected

B) private and public

C) protected and public

D) private, protected and public

126) We can overload which of the following C++ operators.

A) Arithmetic operator (+, -, *, /)

B) Class Member Access Operators (., .*)


C) Size operator(sizeof)

D) Conditional operator(?:)

128) ……………… must be either non-static member function or friend functions.

A) member functions

B) Operator functions

C) non-static functions

D) friend functions

129) Operator overloading is also called …………….. polymorphism.

A) run time

B) initial time

C) compile time

D) completion time

130) We can overload almost all the C++ operators except the following.

i) Class member operator (.,.*) ii) Assignment operator (=)

iii) Scope resolution operator (::) iv) Conditional operator (?:)

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv

131) Which of the following is the correct order involves in the process of operator overloading.

i) Define the operator function to implement the required operations.

ii) Create a class that defines the data type that is to be used in the overloading operation.

iii) Declare the operator function op() in the public part of the class.
A) 1-i, 2-ii, 3-iii

B) 1-ii, 2-iii, 3-i

C) 1-ii, 2-i, 2-iii

D) 1-iii, 2-ii, 3-i

132) State whether the following statements are True or False for overloading operators.

i) Only existing operators can be overloaded.

ii) We can change the basic meaning of an operator

A) True, True

B) True, False

C) False, True

D) False, False

133) We cannot use friend functions to overload which of the following operators.

i) membership operator(.) ii) Assignment operator(=)

iii) class member access operator(_>) iv) conditional operator(?:)

A) i and ii only

B) ii and iii only

C) iii and iv only

D) i and iv only

134) …………… overloaded by means of a member function, take no explicit arguments and return no
explicit values.

A) Unary operators

B) Binary operators

C) Arithmetic operators

D) Function operator
135) ……………. overloaded through a member function take one explicit argument and those which are
overloaded through a friend function take two explicit arguments.

A) Unary operators

B) Binary operators

C) Arithmetic operators

D) Function operator

136) When using ………………., overloaded through a member function, the left hand operand must be an
object of the relevant class.

A) Unary operators

B) Binary operators

C) Arithmetic operators

D) Function operator

137) Operator overloading is done with the help of a special function called ……………, which describes
the special task of an operator.

A) overloading function

B) special task function

C) detail function

D) operator function

138) The compiler does not support automatic type conversions for the ………….. data type.

A) basic

B) user defined

C) class

D) automatic

139) The casting operator function should satisfy which of the following conditions.

i) It must be a class member ii) It must not specify return type


iii) It must not have any arguments

A) i and ii only

B) ii and iii only

C) i, iii only

D) All i, ii and iii

140) The conversion from a class to any other type or any other class should make use of a ………….. in
the source class.

A) casting operator

B) constructor

C) not applicable

D) operator function

141) To perform the conversion from any other data type or class to a class type, a ………….. should be
used in the destination class.

A) casting operator

B) constructor

C) not applicable

D) operator function

142) The general form of an overloaded casting operator function usually referred to as a ……………..

A) casting function

B) operator function

C) conversion function

D) overloaded function

143) Operator overloading provides a flexible option for the creation of new …………….. for most of the
C++ operations.

A) class

B) function
C) object

D) definitions

144) In the case of …………….. function, arguments may be passed either by value or by reference.

A) private

B) friend

C) member

D) public

145. C++ provides a special ………………… called the constructor, which enables an object to initialize itself
when it is created.

A) friend function

B) member function

C) public function

D) private function

146. A constructor has the same …………….. as that of class.

A) variable

B) object

C) function

D) name

147. Constructors are normally used to …………….. and to allocate memory.

A) define variables

B) allocate variables

C) initialize variables

D) initialize object
148. A constructor that accepts no parameters is called the …………….

A) default constructor

B) parameterized constructor

C) implicit constructor

D) null constructor

149. Constructors cannot be inherited, through a derived class can call the ………………. constructor.

A) base class

B) derived class

C) void class

D) default class

150. State whether the following statements about the constructor are True or False.

i) constructors should be declared in the private section.

ii) constructors are invoked automatically when the objects are created.

A) True, True

B) True, False

C) False, True

D) False, False

151. The constructors that can take arguments are called …………… constructors.

A) default constructor

B) parameterized constructor

C) implicit constructor

D) argument constructor
152. When an object is created and initialized at the same time, a ………………. gets called.

A) default constructor

B) parameterized constructor

C) implicit constructor

D) copy constructor

153. In C++, ……………………. creates objects, even through it was not defined in the class.

A) default constructor

B) parameterized constructor

C) implicit constructor

D) copy constructor

154. …………….. constructor will not do anything and defined just to satisfy the compiler

A) default

B) parameterized

C) implicit

D) copy

155. The ………………… constructor can be called with either one argument or no arguments.

A) default

B) default argument

C) implicit

D) copy

156. A ………………….. is used to declare and initialize an object from another object.

A) default constructor

B) default argument constructor

C) implicit constructor
D) copy constructor

157. A ……………. takes a reference to an object of the same class as itself as an argument.

A) default constructor

B) default argument constructor

C) implicit constructor

D) copy constructor

158. Destructor is a member function whose name is same as the class name but is preceded by a ………..

A) tilde

B) hash

C) dot

D) dollor

159. A destructor is used to destroy the objects that have been created by a ………………..

A) object

B) class

C) function

D) constructor

160. Whenever const objects try to invoke non-const member functions, the compiler …………………

A) return zero value

B) return null

C) generate error

D) return no value

161. Allocation of memory to objects at the time of their construction is known as ……………. of objects.

A) run time construction

B) dynamic construction
C) initial construction

D) static construction

162. The process of initializing through a copy constructor is known as ……………

A) copy process

B) copy registration

C) copy initialization

D) initialization process

163. ……………….. provides the flexibility of using different format of data at runtime depending upon the
situation.

A) dynamic initialization

B) run time initialization

C) static initialization

D) variable initialization

164. An ………………….. with a constructor or destructor cannot be used as a member or a union.

A) class

B) object

C) function

D) variable

165. In C++, the declaration of functions and variables are collectively called …….

A) class members

B) function members

C) object members

D) member variables

166. The keywords private and public used in C++ are known as ………….
A) keyword labels

B) visibility labels

C) declaration labels

D) display labels

167. The variables declared inside the class are known as data members and functions are known as
………….

A) data functions

B) inline functions

C) member functions

D) member variables

168. Only the …………………. can have access to the private members and private functions.

A) data functions

B) inline functions

C) member functions

D) member variables

169. The binding of data and functions together into a single class-type variable is referred to as …………..

A) encapsulation

B)

C)

D)

170. Which of the following statements about member functions are True or False.

i) A member function can call another member function directly with using the dot operator.

ii) Member function can access the private data of the class.
A) i-True, ii-True

B) i-False, ii-True

C) i-True, ii-False

D) i-True, ii-True

171. When the function is defined inside a class, it is treated as ………………….

A) data function

B) inline function

C) member function

D) member variable

172. A member function can be called by using its name inside another function of the same class,
which is known as ………… of member function.

A) sub function

B) sub member

C) nesting

D) sibling

172. A ………………. member function can only be called by another function that is member of it’s class.

A) friend

B) static

C) public

D) private

173. ……………….. member variable is initialized to zero when the first object of its class is created where
no other initialization is permitted.

A) friend
B) static

C) public

D) private

174. State whether the following statements are True or False about the characteristics of static data
members.

i) Only one copy of static member is created for the entire class and is shared by all the objects of that
class, no matter how many objects are created.

ii) Static member variable is visible only within the class, but its lifetime is the entire program.

A) i-True, ii-True

B) i-False, ii-True

C) i-True, ii-False

D) i-True, ii-True

175. Static variables are associated with the class itself rather than with any class object, they are also
known as …………….

A) class variables

B) object variables

C) function variables

D) internal variables

176. Static variables are like ………………… as they are declared in a class declaration and defined in the
source file.

A) inline member function

B) non inline member function

C) static member function

D) dynamic member function

177. A …………….. can have access to only other static members declared in the same class.

A) constant member function


B) private member function

C) static member function

D) friend function

178. A static member function can be called using the ………………… instead of its objects.

A) variable name

B) function name

C) Class name

D) object name

179. While using an object as a function argument, a copy of the entire object is passed to the function
in ………….. method.

A) pass-by-value

B) pass-by-reference

C) pass-by-variable

D) pass-by-function

180. A ……………………., although not a member function, has full access rights to the private members of
the class.

A) constant member function

B) private member function

C) static member function

D) friend function

181. ……………. can be invoked like a normal function without the help of any object.

A) constant member function

B) private member function

C) static member function

D) friend function
182. A ………….. can only be called by another function that is member of its class.

A) constant member function

B) private member function

C) static member function

D) friend function

183. If a member function does not alter any data in the class, that may be declared as ………………..

A) constant member function

B) private member function

C) static member function

D) friend function

184. In C++, we can give several meanings to an operator, depending upon the types of arguments used,
which was known as …………..

A) Operator variable

B) Operator overloading

C) Operator loading

D) Operator manipulation

185. Which of the following is/are the pointer-to-member operator used in C++.

i) : : ii) : : * iii) _>* iv) . *

A) i and ii only

B) ii and iiii only

C) i and iv only

D) iii and iv only


186. Which of the following is the scope resolution operator in C++.

A) : :

B) : : *

C) _>*

D) . *

186. …………….. operator can be used to uncover a hidden variable.

A) pointer-to-member

B) memory release

C) scope resolution

D) line feed

187. A major application of the ………………… operator is in the classes to identify the class to which a
member function belongs.

A) pointer-to-member

B) memory release

C) scope resolution

D) line feed

188. ……………….. operator is used to access a member using a pointer to the object and a pointer to that
member.

A) : :

B) : : *

C) _>*

D) . *

189. ………………. operator is used to declare a pointer to a member of a class.

A) : :

B) : : *
C) _>*

D) . *

190. The ………………. operator allocates sufficient memory to hold a data object type data type and
returns the address of the object.

A) malloc()

B) calloc()

C) new

D) free()

191. The expression …………….. will delete the entire array pointed to by p.

A) delete all p;

B) delete array p;

C) delete * p;

D) delete[ ] p;

192. The ……………… operator automatically returns the correct pointer type, so that there is no need to
use a type cast.

A) new

B) delete

C) malloc()

D) setw

193. The …………….. manipulator is used in an output statement which causes a linefeed to be inserted.

A) setw

B) delete

C) endl
D) symbol

194. Which of the following is/are the new cast operators used in C++.

i) const_cast ii) static_cast iii) dynamic_cast iv) new_cast

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv

195. A/An …………………. is a combination of operator, constants and variables arranged as per the rules
of the language.

A) token

B) expression

C) structure

D) none

196. Which of the following is/are the types of C++ expressions.

i) constant expressions ii) integral expressions

iii) float expressions iv) null expressions

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv

197. ……………………. produce results of type bool which takes a value true or false.

A) Relational expressions

B) Float expressions

C) Logical expressions

D) Bitwise expressions
198. ……………… combine to or more relational expressions and produces bool type results.

A) Relational expressions

B) Float expressions

C) Logical expressions

D) Bitwise expressions

199. The ………………… is an entry-enrolled loop and is used when an action is to be repeated for
predetermined number of times.

A) while

B) for

C) do-while

D) switch

200. The ………………….. is an exit-enrolled loop where the control is transferred back to a particular point
in the program.

A) while

B) for

C) do-while

D) switch

201. The ………………… is a multiple-branching statement where,

based on a condition, the control is transferred to one of the many

possible points.

A) while

B) for

C) do-while

D) switch
202. The operator ………………… is known as compound assignment or short-hand assignment operator.

A) =

B) = =

C) += =

D) +=

203. C++ provides various types of …………………… tokens that includes keywords, identifiers, constants,
strings and operators.

A) tokens

B) expressions

C) structures

D) none

204. …………………. refer to the names of variables, functions, arrays, classes etc. created by programmer.

A) Keywords

B) Identifiers

C) Constants

D) Strings

205. ………………….. are explicitly reserved identifiers and cannot be used as names for the program
variables or other user defined program elements.

A) Keywords

B) Identifiers

C) Constants

D) Strings

206. State whether the following statements are True or False for C++ identifiers.
i) Only alphabetic characters, digits and underscores are permitted.

ii) The name can start with a digit.

iii) Uppercase and lowercase letters are distinct.

A) i-True, ii-True, iii-False

B) i-True, ii-False, iii-True

C) i-True, ii-False, iii-False

D) i-True, ii-True, iii-True

207. In C++, ………………….. refer to fixed values that do not change during the execution of a program.

A) Identifiers

B) Constants

C) Strings

D) Operators

208. C++ provides an additional use of …………………….., for declaration of generic pointers.

A) int

B) float

C) void

D) double

209. The ……………………. data type was used to specify the return type of a function when it is not
returning any value.

A) int

B) float

C) void

D) double
210. A ………………….. can be assigned a pointer value of any basic data type, but it may not de-
referenced.

A) int pointer

B) void pointer

C) generic pointer

D) non-void pointer

211. Which of the following is NOT the user defined data type in C++.

A) Structure

B) Pointer

C) Union

D) Class

212. Which of the following is/are the derived data types in C++.

i) array ii) function iii) pointer iv) class

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv

11. In the case of ……………………… in C++, we can not modify the address that the pointer is initialized.

A) constant pointer

B) pointer to a constant

C) pointer constant

D) constant to a pointer

213. In the case of ………………………. in C++, contents of what it points to cannot be changed.

A) constant pointer

B) pointer to a constant

C) pointer constant
D) constant to a pointer

214. Which of the following is the correct way of declaring constant pointer in C++.

A) char const * pointer1=”OK”;

B) char * const pointer1=”OK”;

C) const * char pointer1=”OK”;

D) const char * pointer1=”OK”;

215. Which of the following is the correct way of declaring pointer to a constant in C++.

A) int * const pointer1=&p;

B) const * int pointer1=&p;

C) int const * pointer1=&p;

D) int pointer1 * const=&p;

216. We can create …………………….. in C++ using the qualifier constant and defining a set of integer
constant using enum keywords.

A) basic constant

B) number constant

C) symbolic constant

D) named constant

217. The …………………… are just like variables except that their values cannot be changed.

A) basic constant

B) number constant

C) symbolic constant

D) named constant

218. ………………… are widely used in C++ for memory management and to achieve polymorphism.

A) Pointers
B) Array

C) Function

D) Class

219. C++ permits initialization of the variables at run time which is referred to as ……………….
initialization.

A) static

B) dynamic

C) variable

D) runtime

220. …………………….. used in C++ provides an alias (alternative name) for a previously defined variables.

A) alias

B) alternative

C) defined

D) reference

221. A reference variable must be initialized at the time of ………………………………

A) initialization

B) declaration

C) running

D) definition

You might also like