1. CRACK THE CODE
Designed by The Smartpath Information Systems
1) What will be the outputof followingcode
{
Int x=10,y=15;
X=x++;
Y=++y;
Cout<<x<<y;
}
A. 10,15
B. 10,16
C. 11,16
D. 11,15
2) Null pointercanbe usedas
A. To stop indirectioninarecursive data structure
B. As an errorvalue
C. As a sentinel value
D. All of above
3) Whichof the followingstatementscreatesinfinite loop?
A. For( ; ; )
B. While( ;; )
C. When( ; ; )
D. If( ; ; )
4) What isthe functionoverloading?
A. Callingafunctionfromanotherfunction
B. Havingmore than one functionsof same name
C. Callingafunctionfronitself
D. There isno such termin c++
5) To use the functiontolower(),whichof the followingheaderfile shouldinclude?
A. String.h
B. Conio.h
C. Ctype.h
D. Don’tneedanyheaderfile
2. CRACK THE CODE
Designed by The Smartpath Information Systems
6) The use of “break” statement
A. To terminate acase inthe switchstatement
B. To force immediate terminationof aloop
C. Both A & B
D. OnlyA
7) In an assignmentstatement
a=b;
Whichof the followingstatementistrue?
A. The variable a andthe variable bare equal.
B. The value of b is assignedtovariable abutthe laterchangesonvariable bwill noteffectthe
value of variable a.
C. The value of b is assignedtovariable aand the laterchange on variable bwill effectthe value
of variable a.
D. The variable of value a isassignedtovariable bandthe value of variable bisassignedto
variable a.
8) Whichof the followingisnota validescape code?
A. t
B. v
C. f
D. w
9) The c++ symbol <<
A. Performthe actionof sendingthe value of expressionlistedasitsrightto the outputstream as
the left.
B. Is used to indicate the actionfromrightto left.
C. Is adoptedtoresemble anarrow.
D. All of above
10) Whena language has the capabilitytoproduce new datatype,itiscalled
A. Extensible
B. Overloaded
C. Encapsulated
3. CRACK THE CODE
Designed by The Smartpath Information Systems
D. Reprehensible
11) State the ObjectOrientedlanguages
A. C++
B. Java
C. Eiffel
D. All of the above
12) Keywordusedfordynamicmethodresolution?
A. Abstract
B. Dynamic
C. Virtual
D. Typeid
13) The term STL standsfor?
A. Simple TemplateLibrary
B. StaticTemplate Library
C. Single Type BasedLibrary
D. StandardTemplate Library
14) What is the implicit pointer that is passed as the first argument for nonstatic member
functions?
A. Self pointer
B. Std::auto_ptr pointer
C. Myself pointer
D. This pointer
15) Whichof the followingprovidesareuse mechanism?
A. Abstraction
B. Inheritance
C. Dynamicbinding
D. Encapsulation
16) Whichof the followingstatementsiscorrect?
4. CRACK THE CODE
Designed by The Smartpath Information Systems
A. Base class pointercannotpointtoderivedclass
B. Derivedclasspointercannotpointtobase class
C. Pointertoderivedclasscannotbe created
D. Pointertobase class cannotbe created
17) Whichof the followingconceptsmeansdeterminingatruntime whatmethodtoinvoke?
A. Data hiding
B. Dynamictyping
C. Dynamicbinding
D. Dynamicloadind
18) What iscorrect about the static data memberof a class?
A. A staticmemberfunctioncanaccessonlystatic data membersof aclass
B. A staticdata memberissharedamongall the objectof the class
C. A staticdata membercan be accesseddirectlyfrommain()
D. Both A and B
19) Whichof the followingstatementsiscorrect?
A. Classisan instance of object
B. Objectisan instance of a class
C. Classsisan instance of data type
D. Objectisan instance of data type
20) Whichone of the followingoptioniscorrect?
A. Friendfunctioncanaccesspublicdata membersof the class
B. Friendfunctioncanaccessprotecteddatamembersof the class
C. Friendfunctioncanaccessprivate data membersof the class
D. All of the above
21) Whichof the followingisusedtomake an abstract class?
A. Declaringitabstract usingstatickeyword
B. Declaringitabstract usingvirtual kwyword
C. Making at leastone memberfunctionasavirtual function
D. Making atleastone memberfunctionaspure virtual function
22) Whichinheritance type isusedinthe classgivenbelow?
5. CRACK THE CODE
Designed by The Smartpath Information Systems
ClassA:publicx,publicy
{}
A. Multilevelinheritance
B. Multiple inheritance
C. Hybridinheritance
D. Hierarchical inheritance
23) Whichof the followingoperatorcannotbe overloaded
A. []
B. ->
C. >:
D. *
24) Whichone of the followingisthe correctway to declare apure virtual function?
A. Virtual voidDisplay(void){0};
B. Virtual voidDisplay=0;
C. Virtual voidDisplay(void)=0;
D. VoidDisplay(void)=0;
25) Whichof the followingisamechanismof staticpolymorphism?
A. Operatoroverloading
B. Functionoverloading
C. Templates
D. All of the above
26) Whichof the followingiscorrectaboutthe statementsgivenbelow?
1. All operatorscan be overloadedinC++
2. We can change the basic meaningof anoperatorin C++
A. OnlyI istrue
B. Both I andII are false
C. OnlyIIis true
D. Both I andII are true
27) What happensif the base and derivedclasscontainsdefinitionof afunctionwiththe same
prototype?
A. Compilerreportsanerroron compilation
6. CRACK THE CODE
Designed by The Smartpath Information Systems
B. Onlybase classfunctionwill getcalledirrespectiveof object
C. Onlyderivedclassfunctionwill getcalled irrespective of object
D. Base class objectwill call base classfunctionandderivedclassobjectwill call derivedclass
function
28) Whichof the followingfactorssupportsthe statementthatreusabilityisadesirable featureof a
language?
A. It decrease the testingtime
B. It lowersthe maintenance cost
C. It reduce the compilationtime
D. Both A and B
29) Whichof the followingwaysare legal toaccessa classdata memberusingthispointer?
A. this->x
B. this.x
C. *this.x
D. *this-x
30) Whichof the followingproblemcausesanexception?
A. Missingsemicoloninstatementinmain().
B. A problemincallingfunction.
C. A syntax error.
D. A run-time error.
31) How manytypesof polymorphismssupportedbyc++?
A. 1
B. 2
C. 3
D. 4
32) Whichof the followingconceptof oopsallowstoinsertargumentsinafunctioncall if itis not
specified?
A. Call by value
B. Call by reference
C. Defaultarguments
D. Call by pointer
7. CRACK THE CODE
Designed by The Smartpath Information Systems
33) How manyinstances of an abstract classcan be created?
A. 1
B. 5
C. 13
D. 0
34) Whichof the followingcannotbe friend?
A. Function
B. Class
C. Object
D. Operatorfunction
35) How “Late binding’isimplementedinC++?
A. UsingC++ tables
B. Usingvirtual tables
C. Usingindexedvirtual tables
D. Usingpolymorphictables