You are on page 1of 11

001. How many specifiers are present in access specifiers in class?

C
A 1 B 2
C 3 D 4
002. Which is used to define the member of a class externally B
A : B ::
C # D none of the mentioned
003. Which of the following is not a type of constructor? B
A Copy constructor B Friend constructor
C Default constructor D Parameterized constructor
004. Which of the following is not the member of class? B
A Static function B Friend function
C Const function D Virtual function
005. What does your class can hold? C
A data B functions
C both data & functions D none of the mentioned
006. Which of the following type of class allows only one object of it to be created? B
A Virtual class B Abstract class
C Singleton class D Friend class
007. The fields in the class in c++ program are by default B
A protected B Private
C Public D none of the mentioned
008. Which of the following concepts of OOPS means exposing only necessary information to client? C
A Encapsulation B Abstraction
C Data hiding D Data binding
009. Where does the object is created? A
A Class B Constructor
C Destructor D attributes
010. How to access global variables in the class? A
A scope resolution operator B ternary operator
C direct member access operator D none of the mentioned
011. Which of the following cannot be friend? C
A Function B Class
C Object D Operator function
012. Which of the following is a valid class declaration? A
A class a { int x; }; B class b { }
C public class a { } D object a { int x; };
013. How many instances of an abstract class can be created? D
A 1 B 5
C 13 D 0
014. Which other keywords are also used to declare the class other than class? A
A Struct B Function
C Object D class
015. Constructors are used to A
A initalize the objects B construct the data members
C both initalize the objects & construct the D Object composition
data members
016. Which of the following is an abstract data type? D
A Int B Double
C String D Class
017. Which of the following statement is correct? A
A A constructor is called at the time of B A constructor is called at the time of use
declaration of an object. of an object.
C A constructor is called at the time of D A constructor is called at the time of use
declaration of a class. 2nd of a class.
018. When struct is used instead of the keyword class means, what will happen in the program? A
A access is public by default B access is private by default
C access is protected by default D none of the mentioned
019. Which of these following members are not accessed by using direct member access operator? D
A Pub B Private
C Protected D both private & protected
020. Pick out the definition of objects. D
A member of the class B associate of the class
C attribute of the class D instance of the class
021. coutis a/an __________ . C
A Operator B Function
C Object D Macro
022. Which of the following concepts provides facility of using object of one class inside another C
class?
A Encapsulation B Abstraction
C Composition D Inheritance
023. Which of the following approach is adapted by C++? B
A Top-down B Bottom-up
C Right-left D Left-right
024. Which of the following is correct about class and structure? D
A class can have member functions while B class data members are public by default
structure cannot while that of structure are private.
C Pointer to structure or classes cannot be D class data members are private by default
declared. while that of structure are public by
default.
025. Which of the following concepts means wrapping up of data and functions together? B
A Abstraction B Encapsulation
C Encapsulation D Polymorphism
026. Everything defined at the program scope level (ie. outside functions and classes) is said to be C
A local scop B regional scope
C global scope D static scope
027. Operators such as . cannot be overloaded. C
A + B ++
C :: D ==
028. To overload an operator keyword must be used along with the operator to be overloaded. D
A Over B Overload
C Void D Operator
029. How many objects can be created from a single class? D
A 1 B 2
C 3 D as many as possible
030. Which special character is used to mark the end of class? A
A ; B :
C # D $
031. ____ have the return type void? D
A all functions B constructors
C Destructors D none of the mentioned
032. What does the following statement mean? void a; D
A variable a is of type void B a is an object of type void
C declares a variable with value a D flags an error
033. Which of the following concepts means waiting until runtime to determine which function to C
call?
A Data hiding B Dynamic casting
C Dynamic binding D Dynamic loading
034. Which of the following operator is overloaded for object cout? B
A >> B <<
C + D =
035. which of the following is used to terminate the function declaration? C
A : B )
C ; D none of the mentioned
036. Which of the following will not return a value? B
A Null B Void
C Empty D free
037. The size t integer type in C++ is? C
A Unsigned integer of at least 64 bits B Signed integer of at least 16 bits
C Unsigned integer of at least 16 bits D Signed integer of at least 64 bits
038. Where does the execution of the program starts? B
A user-defined function B main function
C void function D none of the mentioned
039. C++ was originally developed by; D
A Clocks in and Mellish B Donald E. Knuth
C Sir Richard Hadlee D Bjame Stroustrup
040. Choose the correct remarks. C
A C++ allows any operator to be B Some of the existing operators cannot be
overloaded. overloaded.
C Operator precedence cannot be changed. D All of the above.
041. cout stands for C
A class output B Character output
C Common output D call output
042. The fields in a structure of a C program are by default B
A Protected B Public
C Private D none of the above
043. Choose the incorrect option B
A void is used when the function does not B void is also used when the value of a
return a valu pointer is nul
C void is used as the base type for pointers D void is a special fundamental type
to objects of unknown ty
044. Which of the following is a mechanism of static polymorphism? B
A Function overriding B Function overloading
C Templates D Class
045. Which of the following cannot be used with the keywordvirtual? C
A Class B member functions
C Constructor D Destructor
046. Which of the following functions are performed by a constructor? D
A Construct a new class B Construct a new object
C Construct a new function D Initialize objects
047. In which of the following a virtual call is resolved at the time of compilation? D
A From inside the destructor. B From inside the constructor.
C From inside themain(). D Both A and B
048. Which of the following header file includes definition ofcinandcout? D
A istream.h B ostream.h
C iomanip.h D iostream.h
049. Forgetting to include a file (like cmath or math.h) that is necessary will result in C
A compilation error B warning when the program is run
C error at link time D warning when the program is compiled
050. At what point of time a variable comes into existence in memory is determined by its B
A Scope B storage class
C data type D all of the above
051. Which of the following is not a type of inheritance? C
A Multiple B Multilevel
C Distributive D Hierarchical
052. Which of the following operators cannot be overloaded? C
A [] B ->
C ?: D *
053. Which of the following is correct about the statements given below? 1. All operators can be B
overloaded in C++. We can change the basic meaning of an operator in C++.
A Only I is true B Both I and II are false
C Only II is true. D Both I and II are true.
054. Which of the following are available only in the class hierarchy chain? C
A Public data members B Private data members
C Protected data members D Member functions
055. Identify the user-defined types from the following? A
A Enumeration B Char
C Float D int
056. Which of the following keyword is used to overload an operator? B
A Overload B Operator
C Friend D override
057. What will happen if a class is not having any name? D
A It cannot have a destructor. B It cannot have a constructor.
C It is not allowed. D Both A and B
058. Which inheritance type is used in the class given below? class A : public X, public Y {} B
A Multilevel inheritance B Multiple inheritance
C Hybrid inheritance D Hierarchical Inheritance
059. Which data type is used to represent the absence of parameters? C
A Int B Short
C Void D Float
060. Which type is best suited to represent the logical values? B
A Integer B Boolea
C Character D all of the mentioned
061. Which of the following is/are the header files listed in C++ standard library. i) <ctype.h> ii) B
<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
062. Pick the odd one out A
A array type B character type
C boolean type D integer type
063. Which of the following statements is correct in C++? B
A Classes cannot have data as protected B Structures can have functions as
members. members.
C Class members are public by default. D Structure members are private by default.
064. Which of the following is used to make an abstract class? D
A Declaring it abstract using static keyword. B Declaring it abstract using virtual
keyword.
C Making at least one member function as D Making at least one member function as
virtual function. pure virtual function.
065. Which header file is used with input and output operations of C in C++? B
A stdio.h B Cstdio
C Iostream D none of the mentioned
066. Which will be used with physical devices to interact from C++ program? C
A Programs B Library
C Streams D None of the mentioned
067. Pick the odd one out. C
A integer, character, boolean, floating B enumeration, classes
C integer, enum, void D arrays, pointer, classes
068. Which of the following is an invalid visibility label while inheriting a class? D
A Public B Private
C Protected D friend
069. The value 132.54 can represented using which data type? A
A Double B Void
C Int D bool
070. When a language has the capability to produce new data type mean, it can be called as B
A overloaded B Extensible
C Encapsulated D reprehensible
071. Which of the following provides a reuse mechanism? B
A Abstraction B Inheritance
C Dynamic binding D Encapsulation
072. The OOPs concept, exposing only necessary information to users or clients is known as A
A Abstraction B Encapsulation
C Data hiding D Hiding complexity
073. The term __________ means the ability to take many forms. B
A Inheritance B Polymprphism
C Member Function D Encapsulation
074. Which of the following access specifier is used as a default in a class definition? C
A Protected B Public
C Private D friend
075. Which of the following cannot be declared static? A
A Class B Structure
C Functios D union
076. The order in which operands are evaluated in an expression is predictable if the operator is; D
A * B +
C % D &&
077. What will be the output of following program? #include<iostream.h> void main() { float x; x= A
(float)9/2; cout<<x; }
A 4.5 B 4.0
C 4 D 5
078. For Cat and Animal class, correct way of inheritance is A
A class Cat: public Animal B class Animal: public Cat
C Both are correct way D None is correct way
079. In a class, encapsulating an object of another class is called A
A Composition B Inheritance
C Encapsulation D None
080. 1. #include <iostream> 2. using namespace std; 3. int main() 4. { 5. int const p = 5; 6. cout << C
++p; 7. return 0; 8. }
A 5 B 6
C Error D None of the mentioned
081. Which operation is used as Logical'AND ' C
A Operator-& B Operator-||
C Operator-&& D Operator +
082. Hiding the complexity is known as B
A Abstraction B Encapsulation
C Data hidin D Composition
083. In C++ Program, inline fuctions are expanded during ____ A
A Run Time B Compile Time
C Debug Time D Coding Time
084. How the constants are declared? C
A const keyword B #define preprocessor
C both const keyword and #define D none of the mentioned
preprocessor
085. The return type you code for all constructors is _____ D
A Void B the class type
C the same type as the first data member D no type
defined in the class
086. Output of following program? #include<iostream> using namespace std; class Point { Point() { A
cout << "Constructor called"; } };int main() { Point t1; return 0; }
A Compiler Error B Runtime Error
C Constructor called D Display output Constructed called
087. A fundamental type such as int or double is a _____ D
A programmer-defined type B complex type
C nonscalar type D scalar type
088. Features not available in C++ object oriented programming is B
A Virtual destructor B Virtual constructor
C Virtual function D All
089. The size of an object or a type can be determined using which operator? B
A Malloc B Sizeof
C Malloc D calloc
090. ---------IS A relationship in C++ is A
A Inheritance B Encapsulation
C Composition D None
091. The compiler converts your C++ instructions into _____ B
A edited code B object code
C source code D translated code
092. Using a statement at the wrong time or with an inappropriate object creates a A
A logical error B syntax error
C compiler error D language error
093. When you create a derived class and instantiate an object _____ A
A the parent class object must be B the child class object must be constructed
constructed first first
C the parent class object must not be D the child class object must not be
constructed constructed
094. Not using virtual destructor feature in a C++ object oriented programming can cause A
A Memory leak B An Issue in creating object of the class
C An issue in calling base class destructor D Nothing
095. Output of following program? #include<iostream> using namespace std;class X{ public: int x; C
};int main() { X a = {10}; X b = a; cout << a.x << " " << b.x; return 0; }
A Compiler Error B 10 followed by Garbage Value
C 10 10 D 10 0
096. If you want to write multiple functions in a class with same name, then what C++ feature will C
you use?
A Function overriding B Encapsulation
C Function overloading D None
097. Polymorphism types is/are C
A Compile time B Run time
C Both D None
098. If I want to have common functions in a class and want to defer implementations of some other B
functions to derived classes, then we need to use
A An interface B An abstract class
C A friend class D A static class
099. The declaration of structure is also called as? C
A structure creator B structure signifier
C structure specifier D none of the mentioned
100. Which of the following is a properly defined structure? D
A struct {int a;} B struct a_struct {int a;}
C struct a_struct int a; D struct a_struct {int a;};
101. What will happen when the structure is declared? A
A it will not allocate any memory B it will allocate the memory
C it will be declared and initialized D none of the mentioned
102. A constructor always has B
A communicational cohesion B temporal cohesion
C logical cohesion D no cohesion
103. A normal C++ operator that acts in special ways on newly defined data types is said to be D
A Glorified B Encapsulated
C classified D overloaded
104. Which C++ oops feature is related to re-usability? B
A Encapsulation B Inheritance
C Abstraction None D
105. The data elements in structure are also known as what? B
A Objects B Members
C Datas D none of the mentioned
106. "C++" is a _____ constant D
A character literal B named literal
C numeric literal D string literal
107. #include <iostream> using namespace std; enum test { A = 32, B, C }; int main() { cout << A A
<< B<< C; return 0; }
A 323334 B 323232
C 323130 D 1234
108. The scope resolution operator is D
A a comma B a semicolon
C a colon D two colons
109. Which interface determines how your class will be used by other program? A
A Public B Private
C Protected D none of the mentioned
110. In which statements, does a 'continue ' statements cause the control to go directly to the test D
condition and then continue the looping process?
A 'for ' and'while ' B 'while ' and'if-else '
C 'do-while ' and 'if-else ' D 'while ' and 'do-while '
111. Which of the following statements is false? B
A You typically use a public member B Because the constructor function does not
function to change the value in a private return a value, you place the keyword
data member void before the constructor 's name
C The public member functions in a class D An instance of a class is considered an
can be accessed by any program that uses object
an object created from that class
112. In a class specifier, data or functions designated private are accessible C
A to any function in the program B only if you know the password
C to member functions of that class D only to public members of the class
113. The feature in object-oriented programming that allows the same operation to be carried out B
differently, depending on the object, is_____
A Inheritance B Polymorphism
C over functioning D overriding
114. Which of the following is not one of the sizes of the floating point types? A
A short float B float
C long double D double
115. A translator that notes whether you have used a language correctly may be called a _____ B
A Thesaurus B Compiler
C Coder D decoder
116. Which of the following statement is not true about preprocessor directives? D
A These are lines read and processed by the B They do not produce any code by
preprocessor themselves
C These must be written on their own line D They end with a semicolon
117. What does inheritance allows you to do? B
A create a class B create a hierarchy of classes
C access methods D none of the mentioned
118. What is the syntax of inheritance of class? C
A class name B class name : access specifer
C class name : access specifer class name D none of the mentioned
119. The items listed in the function header are called _____ B
A actual arguments B formal parameters
C passed parameters D sent arguments
120. What is the output of this program? 1. #include <iostream> 2. using namespace std; 3. int main() A
4. { 5. float num1 = 1.1; 6. double num2 = 1.1; 7. if (num1 == num2) 8. cout << "stanford"; 9.
else 10. cout << "harvard"; 11. return 0; }
A Harvard B Stanford
C compile time error D runtime error
121. What is the output of the following program? 1. #include <iostream>2. using namespace std;3. C
int main()4. {5. float i = 123.0f;6. cout << i << endl;7. return 0;8. }
A 123.00 B 1.23
C 123 D compile time error
122. Where does a c in stops it extraction of data? A
A By seeing a blankspace B By seeing (
C By seeing a blankspace & ( D None of the mentioned
123. What is the range of the floating point numbers? A
A -3.4E+38 to +3.4E+38 B -3.4E+38 to +3.4E+34
C -3.4E+38 to +3.4E+36 D -3.4E+38 to +3.4E+32
124. Which of three sizes of floating point types should be used when extended precision is required? C
A Float B Double
C long double D extended float
125. The process of extracting the relevant attributes of an object is known as C
A Polymorphism B Inheritance
C Abstraction D data hiding
126. A static data member is given a value B
A within the class definition B outside the class definition
C when the program is executed D never
127. For automatic objects, constructors and destructors are called each time the objects A
A enter and leave scope B inherit parent class
C are constructed D are destroyed
128. If you declare two objects as Customer firstCust, secondCust; which of the following must be C
true?
A Each object 's non static data members B Each object will be stored in the same
will be stored in the same memory memory location
location
C Each object will have a unique memory D You cannot declare two objects of the
address same class
129. Destructor has the same name as the constructor and it is preceded by ______ C
A ! B ?
C ' D $
130. To use one of the C++ built-in mathematical functions, you must include the _____ header file in D
your program
A calculation.h B compute.h
C expression.h D math.h
131. Errors in a program are called C
A Accidents B Annoyances
C Bugs D Mistakes
132. Which is correct with respect to size of the data types? D
A char > int < float B int < char > float
C char < int < float D char < int < double
133. A constructor that accepts __________ parameters is called the default constructor C
A One B Two
C No D Three
134. Which of the following statements will display the word "Hello" on the computer screen? C
A cin << "Hello"; B cin >> "Hello";
C cout << "Hello"; D cout >> "Hello";
135. The most efficient data type for a variable that stores the number 4.6e20 is the _____ data type C
A Character B Double
C Float D Long Integer
136. When a language has the capability to produce new data types, it is said to be D
A Reprehensible B Encapsulated
C Overloaded D extensible
137. Which of the following is the inequality operator? A
A != B ==
C --> D <>
138. The operator that releases previously allocated memory is _____ C
A Release B Return
C Delete D destroy
139. Which constructor function is designed to copy objects of the same class type? D
A Create constructor B Object constructor
C Dynamic constructor D Copy constructor
140. When are the Global objects destroyed? B
A When the control comes out of the block B When the program terminates
in which they are being used.
C When the control comes out of the D As soon as local objects die.
function in which they are being used.
141. Constructors __________ to allow different approaches of object construction B
A cannot overloaded B can be overloaded
C can be called D can be nested
142. If the copy constructor receives its arguments by value, the copy constructor would C
A call one-argument constructor of the class B work without any problem
C call itself recursively D call zero-argument constructor
143. Which of the following can be used to declare the main function? C
A void main B void Main()
C void main() D main
144. Copy constructor must receive its arguments by __________ . C
A either pass-by-value or pass-by-reference B only pass-by-value
C only pass-by-reference D only pass by address
145. A function with the same name as the class, but preceded with a tilde character ( ') is called B
__________ of that class.
A Constructor B Destructor
C Function D object
146. __________ used to make a copy of one class object from another class object of the same class B
type.
A Constructor B copy constructor
C destructor D default constructor
147. Which of the following is a C++ object? A
A Cin B >>
C Iostream D read()

You might also like