1) Which of the following is not a type of 8) A variable defined within a block is visible constructor? A. From the point of definition onward in the A. Copy constructor program B. Friend constructor B. From the point of definition onward in the Answer:. Default B constructor function D. Parameterized constructor C. From the point of definition onward in the Answer:block C D. Throughout the function 2) Which of the following is not the member of class? A. Static function 9) Which of the following term is used for a B. Friend function function defined inside a class? Answer:C. Const B function A. Member Variable D. Virtual function B. Member function Answer:C. Class B function D. Classic function 3) Which of the following concepts means determining at runtime what method to invoke? 10) Which of the following concept of oops A. Data hiding allows compiler to insert arguments in a B. Dynamic Typing function call if it is not specified? Answer:C. Dynamic C binding A. Call by value D. Dynamic loading B. Call by reference Answer:C. Default C arguments D. Call by pointer 4) The friend functions are used in situations where: A. We want to have access to unrelated classes 11) How many instances of an abstract class B. Dynamic binding is required can be created? C. Exchange of data between classes to take A. 1 Answer:place D B. 5 D. None of the above Answer:C. 13 D D. 0

5) The keyword friend does not appear in A. The class allowing access to another class 12) Which of the following cannot be friend? B. The class desiring access to another class A. Function Answer:C. The private C section of a class B. Class D. The public section of a class Answer:C. Object C D. Operator function

6) The term ______means the ability to take many forms. 13) Which of the following concepts of OOPS A. Inheritance means exposing only necessary information to B. Polymorphism client? Answer:C. M emberB function A. Encapsulation D. Encapsulation B. Abstraction Answer:C. Data C hiding D. Data binding 7) C++ was originally developed by A. Clocksin and Melish B. Donald E.Knuth Answer:C. Sir D Richard Hadlee D. Bjarne Stroustrup 14) In structured programming, the problem is 21) Preventing direct access of data-members divided into various ______. of the class from outside world is known as A. modules ____. B. functions (A)Polymorphism Answer:C. structures B (B)Encapsulation D. objects Answer:(C)Data Hiding C (D) scope resolution. 15) In Object-oriented programming, the problem is divided into _____. A. classes & objects 22) What are cin and cout? B. functions (A) pointers Answer:C. structures A (B) functions D. modules Answer:(C) operator C (D) stream objects

16) A class is ____ datatype. A. primitive 23) Which header file must be included for cin B. derived and cout? Answer:C. user-defined C (A) stdio.h D. All of these (B) conio.h Answer:(C) iostream.h C (D) Both iostream.h and conio.h 17) A class is a collection of ____ and_____. (A)data-members & member functions (B)data-members, member functions and 24) Creating a new class using one or more main() existing classes is known as ____. (C) data-members, member functions,main() (A)Polymorphism Answer:and include A statements (B)Encapsulation (D)None of these Answer:(C)overloading D (D)inheritance

18) An object is ...... (A)a variable of class datatype. 25) Ability of an operator or function call to (B)same as a class. take different forms is known as ____. (C)just like a global variable. (A) Polymorphism Answer:(D)collection A of data-members and member (B) Encapsulation functions. Answer:(C) overloading A (D)inheritance

19) Wrapping up of data & functions together 26) cout is a/an ______. in a class is known as _____. A. operator (A)Overloading B. function (B) Data Abstraction Answer:C. object C Answer:(C)Polymorphism D D. macro (D)Encapsulation

27) Which of the following concepts provides 20) Including only necessary details and facility of using object of one class inside ignoring additional details while defining a another class? class is known as ____. A. Encapsulation (A) Overloading B. Abstraction (B) Data Abstraction Answer:C. Composition C Answer:(C) Polymorphism B D. Inheritance (D) Encapsulation 34) Which of the following is correct about 28) How many types of polymorphisms are class and structure? supported by C++? A. class can have member functions while A. 1 structure cannot. B. 2 B. class data members are public by default Answer:C. 3 B while that of structure are private. D. 4 C. Pointer to structure or classes cannot be declared. Answer:D. class data D members are private by default 29) Which of the following is an abstract data while that of structure are public by default. type? A. int B. double 35) Which of the following concepts means Answer:C. string D wrapping up of data and functions together? D. Class A. Abstraction B. Encapsulation Answer:C. Inheritance B 30) A ______is a special method used to D. Polymorphism initialize the instance variable of a class. A. Member function B. Destructor 36) Which of the following concepts means Answer:C. Constructor C waiting until runtime to determine which D. Structure function to call? A. Data hiding B. Dynamic casting 31) Which of the following concepts means Answer:C. Dynamic C binding adding new components to a program as it D. Dynamic loading runs? A. Data hiding B. Dynamic typing 37) Which of the following operator is Answer:C. Dynamic D binding overloaded for object cout? D. Dynamic loading A. >> B. << Answer:C. + B 32) Which of the following statement is D. = correct? A. A constructor is called at the time of declaration of an object. 39) Which of the following is the correct class B. A constructor is called at the time of use of of the object cout? an object. A. iostream C. A constructor is called at the time of B. istream declaration of a class. Answer:C. ostream C Answer:D. A constructor A is called at the time of use of a D. ifstream class.

40) Which of the following cannot be used with 33) Which of the following approach is adapted the keyword virtual? by C++? A. class A. Top-down B. member functions B. Bottom-up Answer:C. constructorC Answer:C. Right B -left D. destructor D. Left-right 41) Which of the following functions are performed by a constructor? 47) Which one of the following options is A. Construct a new class correct? B. Construct a new object A. Friend function can access public data Answer:C. Construct D a new function members of the class. D. Initialize objects B. Friend function can access protected data members of the class. C. Friend function can access private data 42) Which of the following is the correct way of Answer:members D of the class. declaring a function as constant? D. All of the above. A. const int ShowData(void) { /* statements */ } B. int const ShowData(void) { /* statements */ 48) Which of the following statements is } correct in C++? Answer:C. int ShowData(void) C const { /* statements */ } A. Classes cannot have data as protected D. Both A and B members. B. Structures can have functions as members. Answer:C. Class members B are public by default. 43) Which of the following statement is D. Structure members are private by default. correct? A. C++ allows static type checking. B. C++ allows dynamic type checking. 49) Which of the following access specifier is C. C++ allows static member function be of used as a default in a class definition? Answer:type const. D A. protected D. Both A and B. B. public Answer:C. private C D. friend 44) Which of the following header file includes definition of cin and cout? A. istream.h 50) What is correct about the static data B. ostream.h member of a class? Answer:C. iomanip.h D A. A static member function can access only D. iostream.h static data members of a class. B. A static data member is shared among all the object of the class. 45) What will happen if a class is not having C. A static data member can be accessed any name? Answer:directly from D main(). A. It cannot have a destructor. D. Both A and B. B. It cannot have a constructor. Answer:C. It isD not allowed. D. Both A and B. 51) Which of the following provides a reuse mechanism? A. Abstraction 46) Which one of the following is correct about B. Inheritance the statements given below? Answer:C. Dynamic B binding All function calls are resolved at compile- D. Encapsulation time in Procedure Oriented Programming. All function calls are resolved at compile- time in OOPS. 53) Which of the following statement is A. Only II is correct. correct? B. Both I and II are correct. A. Class is an instance of object. Answer:C. Only C I is correct. B. Object is an instance of a class. D. Both I and II are incorrect. Answer:C. Class B is an instance of . D. Object is an instance of data type. 59) Inline Functions are invoked at 53) The process of building new classes from A. Run time existing one is called B. Compile time A. Structure AnswerC. Depends: B on how it is invoked B. Inheritance D. Both b and c above Answer:C. Polymorphism B D. Template 60) which of the following operator is used to define member function outside the class? 54) In a class, member variables are often A. :: called its ______, and its member functions are B. ? sometimes referred to as its behaviour, or Answer:C. :? A ______. D. % A. attributes, methods B. none of these Answer:C. values, A morals 61) function call mechanism that passes D. data, activities arguments to a function by passing a copy of the values of the arguments is ______(A)call by name 55) Which of these keywords are access (B)call by value specifiers? Answer:(C)call by B reference A. near and far (D)call by value result B. opened and closed Answer:C. table andD row D. private and public 62) Data members which are static (A)cannot be assigned a value (B)can only be used in static functions 56) An Object can be declared prior to the class Answer:(C)cannot B be defined in a Union definition (D) can be accessed outside the class Answer:A. True False B. False: 63) Which of the following is false for cin? (A)It represents standard input. 57) Use of ______protects data from (B)It is an object of istream class. inadvertent modifications (C)It is a class of which stream is an object. A. protect() member function Answer:(D)Using Ccin the data can be read from user’s B. private access specifier terminal Answer:C. class protectionB operator, @ D. none of these 64) It is possible to declare as a friend (A) a member function 58) A suitable place to store Class declarations (B) a global function is ______. Answer:(C) a class D A. none of these (D) all of the above B. their own header files C. Auxiliary .cpp file D. main .cpp files, along with function 65) Given a class named Book, which of the Answer:definitions B following is not a valid constructor? (A)Book ( ) { } (B)Book ( Book b) { } Answer:(C)Book ( B Book &b) { } (D)Book (char* author, char* title) { } 66) How many constructors can a class have? 71) Which of the following statements are true (A) 0 in c++? (B) 1 (A) Classes cannot have data as public Answer:(C) 2 D members (D) any number (B) Structures cannot have functions as members Answer:(C) Class membersB are public by default 66) The new operator (D) None of these A) returns a pointer to the variable B) creates a variable called new Answer:C) obtains C memory for a new variable 72) The following can be declared as friend in a D) tells how much memory is available class (A) an object (B) a class 67) A static function Answer:(C) a public B data member A. should be called when an object is destroyed (D) a private data member B. is closely connected with and individual object of a class C. can be called using the class name and 73) A copy constructor takes function name (A) no argument Answer:D. is used C when a dummy object must be (B) one argument created Answer:(C) two arguments B (D) arbitrary no. of arguments

68) We can output text to an object of class ostream using the insertion operator<< 74) Which can be passed as an argument to a because function? (A) the ostream class is a stream (A) constant (B) the insertion operator works with all (B) expression classes Answer:(C) another A function (C) we are actually outputting to cout (D) all of the above. Answer:(D) the insertion D operator is overloaded in ostream 75) Member functions, when defined within the class specification: 69) Which of the following is not the (A) are always inline. characteristic of constructor ? (B) are not inline. (A) They should be declared in the public (C) are inline by default, unless they are too big section. Answeor too complicated.r: A (B) They do not have return type. (D) are not inline by default. Answer:(C) They canD not be inherited. (D) They can be virtual. 76) An entity representing some characteristics and behaviour is- 70) A class defined within another class is: a) object (A) Nested class b) class (B) Inheritance Answer:c) struct A Answer:(C) Containership A d) none of the above (D) Encapsulation 77) Which of the following is not the feature of 84) Which of the following features of object OOPs? oriented programming is false? a) Data Encapsulation a) Data is hidden and is not available to b) Inheritance external functions. Answer:c) Polymorphism D b) New data & functions can be added easily. d) None of the above c) Objects may communicate with each other through functions. Answer:d) Emphasis D is on the procedure rather than 78) The wrapping up of data and functions into data. a single unit is a) Data Abstraction b) Data Encapsulation 85) The following is the C++ style comment Answer:c) Both (a) B & (b) a) // d) None of the above b) /*..*/ Answer:c) – A d) None of the above 79) Which of the following feature supports reusability and extensibility of classes? a) Inheritance 86) Which of the following statements is false? b) Overloading a) Every C++ program must have a main(). Answer:c) Polymorphism A b) In C++, white spaces and carriage returns d) None of the above are ignored by the compiler. Answer:c) C++ statements D terminate with semicolon. d) Main() terminates with semicolon. 80) Inheritance is ………..in nature. a) Intransitive b) Transitive 87) An identifier in C++ Answer:c) Both (a) B & (b) a) Must begin with a letter only d) None of the above b) Is not differentiated by cases Answer:c) Contains C all characters as significant 81) ………… is the ability for a message or data d) None of the above to be processed in more than one form a) Class b) Abstraction 88) ………. Provides a value for a variable Answer:c) Polymorphism C a) declaration statement d) None of the above b) assignment statement Answer:c) definition B statement d) None of the above 82) The smallest individual unit in a program is ……… a) Keyword 89) A collection of variables referred under one b) Identifier name Answer:c) Token C a) Structure d) None of the above b) Class Answer:c) Union A d) None of the above 83) Which of the following features of procedure oriented programming is false a) Large programs are divided into small or 90) A memory location shared by two or more units called functions. different variables b) Employs bottom-up approach in program a) Structure design. b) Class Answer:c) Most of B the functions share global data. Answer:c) Union C d) None of the above. d) None of the above 91) The constants defined using enum 98) << operator is keyword are a) stream insertion operator a) Symbols b) stream extraction operator b) Enumerators Answer:c) left shift A operator Answer:c) Keywords B d) None of the above d) None of the above

99) “H” is an example of 92) The operator ?: is a) character literal a) Logical operator b) string literal b) Relational operator Answer:c) variable B Answer:c) Conditional C operator d) None of the above d) Arithmetic operator

100) Which of the following statements 93) A loop containing other loop is regarding comments is false? a) Nested a) /*..*/ b) Inner b) Comment beginning with // extends to the Answer:c) Outer A end of the line d) None of the above Answer:c) Comments C may be nested d) Comments are used to describe a program

94) The following statement forces the next iteration of the loop to take place 101) C++ is a) break a) Procedural b) continue b) Structural programming language Answer:c) goto B Answer:c) Object orientedC programming language d) None of the above d) None of the above

95) gets() function is available in 102) y=x=2; in C++ will result in a) stdio.h a) compilation error b) string.h b) runtime error Answer:c) ctype.h A Answer:c) assignment C of value to x then to y d) stdlib.h d) None of the above

96) In C++, the statements are enclosed within 103) 31. In C++, ………. is the statement a) parenthesis terminator b) square brackets a) semicolon Answer:c) curly brackets C b) colon d) None of the above Answer:c) new line A d) None of the above

97) The following tells the compiler where the program begins 104) Modules operator (%) has higher a) precedence than b) Forward declaration of class a) Divide (/) operator Answec) main()r: C b) Multiply (*) operator d) None of the above Answer:c) Negation C (unary minus) d) Bitwise left shift operator 105) The result of the following statement is 110) Data members and member functions are int y = 7; enclosed within int ans = ++y; a) class cout<<”ans=”<

118) Using same function name to perform 124) A function defined inside a class is called different tasks is a) A class function a) Function polymorphism b) A friend function b) Runtime polymorphism Answer:c) A member C function Answer:c) Function A prototype d) None of the above d) None of the above

125) Information is made shareable through 119) Default argument is a) inheritance a) Specified in function definition b) data encapsulation b) Specified in function declaration Answer:c) data abstraction A Answer:c) Specified B from left to right d) none of the above d) None of the above

126) Functions can returns 120) What is wrong with the following a) arrays statement? b) reference float s_interest (float principal, int rate=0.25, Answer:c) object D int time); d) all of the above a) variables must not be specified in function prototype b) arguments may only be defaulted from right 127) The memory for date members is to left allocated c) the default value must be specified when a) When a class is defined Answer:making a Bfunction call b) When an object is initialized d) none of the above Answer:c) When an B object is created d) None of the above

121) Which of the following statements regarding function overloading is not true. 128)The memory for member functions is a) If is used to handle different data types at allocated one place a) When a class is defined b) When making a function call, if no exact b) When a object is created match is found, promotion is the only criteria Answer:c) When an A object is initialized to find a match. d) None of the above c) The default arguments can not be used instead of overloading Answer:d) Unrelated C functions should not be 129) The dot operator relates overloaded a) A class member and a class object b) A class object and a class 122) The private members of a class Answer:c) A class Dand a member of that class implement the OOP concept of d) A class object and member of that class a) Data abstraction b) Data hiding Answer:c) Message B passing d) None of the above 130) A class having another class definition is 137) new operator is used a) Nested class a) to define a new variable b) Subordinate class b) to create a new data type Answer:c) Enclosing C class Answer:c) to allocate C memory dynamically d) None of the above d) none of the above

131) A class whose member functions are 138) A constructor function is generally friends of other class is defined a) Friend class a) In the public section of a class b) Abstract class b) In the private section of a class Answer:c) Virtual Aclass Answer:c) In the protected A section of a class d) None of the above d) None of the above

132) The data members of a class are 139) A class having no public constructors is initialized a) A private class a) in class definition b) A public class b) by a non-member function Answer:c) An abstract A class c) through constructor function when a class d) None of the above Answer:object is created C d) none of the above 140) If a constructor function is defined in private section of a class, then 133) A constructor function is a) The object cannot be created a) A friend function to a class b) Only member functions and friends may b) A member function with the same name as declare objects of the class its class Answer:c) Both (a) C & (b) Answer:c) A non- memberB function d) None of the above d) None of the above

141) A constructor with no argument is 134) An enumerated type is composed of a) Default constructor a) Integer values with user defined name b) Parameterized constructor b) Variables of different data types Answer:c) Copy constructor A Answer:c) Constant A numeric values d) None of the above d) None of the above

142) If default arguments are provided to a 135) In C++, the arguments by default are constructor function, then it becomes passed by a) Default constructor a) call be reference b) Copy instructor b) call be value Answer:c) Parameterized A constructor Answer:c) both (a) B & (b) d) None of the above d) none of the above

143) The class of which the objects are not 136) is an example of instantiated is a) unary operator a) Abstract class b) binary operator b) Virtual class Answer:c) ternary C operator Answer:c) Static class A d) none of the above d) None of the above 144) && denotes 151) Which of the following statements a) logical OR regarding constructor is false? b) logical AND a) A constructor may be defined static Answer:c) Bitwise B AND b) Constructor can have default arguments d) None of the above c) Member functions may be invoked from Answer:within a constructor A d) None of the above 145) The parameterized constructor a) Needs initial values as arguments during creation of an object 152) The antonym of constructor is b) Can be invoked explicitly only a) Creator Answer:c) Can be Ainvoked implicitly only b) Destructor d) None of the above Answer:c) Destroyer B d) None of the above

146) Explicit call to a constructor means a) Providing the constructor name explicitly to 153) Variable …………. of invoke it a) May be declared b) Not providing the construction name at all b) Cannot be declared Answer:c) Is the shorthand A method Answer:c) Can be Binitialized d) None of the above d) None of the above

147) Classes in C++ are 154) A destruction function a) Fundamental data type a) Takes no argument and has no return type b) Primitive data type not even void Answer:c) Desired C data type b) Has name similar to that of class, preceded d) None of the above by tilde(~) symbol c) Is used to destruct an object, constructed Answer:through constructor D function 148) A copy constructor is called d) All of the above a) When an object is defined and initialized with another object b) When an object is passed by value 155) Which of the following statements Answer:c) When a D function returns an object regarding destructor function is false? d) All of the above a) Destructors do not accept any arguments, nor do they return any values b) Destructors can be inherited 149) Which of the following regarding c) Member functions may be called from within constructor function is false? a destructor a) Constructor functions don’t have return Answer:d) Destructor B functions are called type, not even void automatically when an object is destroyed b) Constructors can’t be inherited Answer:c) We can C refer to their addresses d) Constructors cannot be virtual 156) Function overloading a) Involves several function definitions under one name, but different argument types 150) If new operator is used, then the b) Implements polymorphism constructor function is c) Reduces the number of comparison in a a) Parameterized constructor program, hence increases the execution speed b) Copy constructor Answer:of a program D Answer:c) Dynamic C constructor d) All of the above d) Default constructor 157) The signature of function is a) The number & type of arguments b) The return type of a function Answer:c) The class A definition d) None of the above

158) Overloading of constructor function a) is similar to function overloading b) different from an overloaded function as it can’t return a value Answc) not er:permitted B in C++ d) none of the above

159) The binding of a function call at runtime is a) Static binding b) Early binding Answer:c) Late binding C d) Runtime binding

160) The process of giving special meaning to an operator is a) Operator overloading b) Operator mechanism Answer:c) Operator A definition d) None of the above

161) What is a comment in c++? a) comments are parts of the source code disregarded by the compiler b) comments are executed by compiler to find the meaning of the comment Answer:c) comments a are executable d) none of the mentioned

162) What type of comments does c++ support? a) single line b) multi line Answer:c) single line C and multi line d) none of the mentioned

163) What is the use of the indentation in c++? a) distinguishes between comments and code b) r distinguishes between comments and outer data Answer:c) both a andA b d) none of the mentioned