0% found this document useful (0 votes)
41 views36 pages

Cs201-Finalterm-Mcqs-Solved-With-References-By-Moaaz Final

The document contains a series of multiple-choice questions related to C++ programming concepts, including topics such as template functions, operator overloading, memory management, and class structures. Each question presents options for answers, testing knowledge on syntax, data types, and programming principles. The questions are designed to assess understanding of fundamental programming concepts in C++.

Uploaded by

Tariq Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views36 pages

Cs201-Finalterm-Mcqs-Solved-With-References-By-Moaaz Final

The document contains a series of multiple-choice questions related to C++ programming concepts, including topics such as template functions, operator overloading, memory management, and class structures. Each question presents options for answers, testing knowledge on syntax, data types, and programming principles. The questions are designed to assess understanding of fundamental programming concepts in C++.

Uploaded by

Tariq Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

CS201-Introductionto Programming

Q.No:1 All A template function must have at least generic data type
Zero One Two Three
Q.No:2 Which of the following statement is best regarding declaration of friend function?
► Friend function must be declared after public keyword
.► Friend function must be declared after private keyword.
► Friend function must be declared at the top with in class definition.
► It can be declared anywhere in classes these are not affected by the public and private keywords.
Q.No:3 Which one of the following is the declaration of overloaded pre-increment operator
implemented as member function?
► Class-name operator+();
► Class-name operator+( int );
► Class-name operator++();
► Class-name operator++(int);
Q.No:4 Class is a user defined .
data type Memory referee Value None of the given options.
Q.No:5 How many bytes will the pointer intPtr of type into move in the following statement? intPtr +=3 ;
3bytes 6bytes 12 bytes 24bytes
Q. No: 6 Which of the following is the correct C++syntax to allocate space dynamically for an array of10 int?
New int(10); New int [10]; Int new(10); int new[10];
Q.No: 7 A Pointer is a special variable that contain
Data values Memory Address Both data and values None of the given option
Q. No: 8 Reference Value Type Data The code is written to the program.
Implement design analysis none of the given options
Q.No: 9 Operator overloading can be performed through .
Classes Function Operators Reference
Q. No: 10 When a value is referred by a normal variable the nit is known as,
Direct Reference Indirect Reference. Partial Reference Proper Reference
Q.No: 11 which of the following function issued to increase the size of already allocated memory chunk?
malloc calloc realloc free
Q. No: 12 Which of the following is NOT a preprocess or directive?
#error #define #line #n define
Q. No: 13 The stream objects cin and cout are included in which header file?
iostream.h fstream.h istream.h ostream.h
Q.No: 14 Overloaded delete operator function takes the same parameter as an argument returned by new
operator function.
True False
Q.No: 15 When an array of object is created dynamically then there is no way to provide parameterized
constructors for array of objects.
True False
Q.No: 16 C is widely known as development language of operating system.
Linux Windows Unix MacOS
Q. No: 17 Computer can understand only machine language code.
True False
Q.No: 18 We cannot define a function as a friend of a Template class.
True False
1
Q.No: 19 What will be the value of ‘a’and‘b’ after executing the following statements?
A=3; b=a++;
3, 4 4, 4 3, 3 4, 3
Q. No: 20 Consider the following code segment. What will be the output of following code?
Int add Value (int *a){
Int b=(*a)+2; return b ;}main({ intx=6;
cout<<x<<“,”;
cout<<add Value(&x)<<“,”;
cout <<x ;}
6,6,8 6,8,6 6,8,8 6,6,6
Q. No: 21 Is used to trace the logic of the program and correct the logical errors.
Compiler Editor Linker Debugger
Q.No: 22 New and delete are where as malloc and free are .
Functions, operators Classes, operators Operators, functions Operators, classes
Q.No: 23 Like member functions, can also access the private at a member sofa class.
Non-member Friend functions Any function outside class None of the given options
functions
Q. No: 24 Which situation would require the use of a non-member overloaded operator?
► The overloaded operator is an Assignment operator.
►The left most operand is an object of a class.
► The left operand is built-in data type.
► The operator returns a reference.
Q.No: 25 The stream insertion and stream extraction operators are already overloaded for .
► User-defined data types
►Built-indatatypeshttp://www.sstutor.com/cpp/stream1.htm
► User-defined and built-in data types
► None of the given options
Q.No:26 If we define an identifier with the statement # define PI3.1415926 then during the execution
of the program the value of PI .
Cannot be replaced None of the given options Remain constant Can be changed by some operation
Q.No: 27 Assignment operator is ----------------- associative.
Right left binary unary
Q.No: 28 when ever dynamic memory allocation is made in C/C++, it is freed .
Explicitly Implicitly Both explicitly and implicitly None of the given options
Q.No: 29 the appropriate data type to store the number of rows and columns of the matrix is .
float int (Not sure) char None of the given options.
Q.No:30 which of the following function do NOT initialize the chunk of memory to all zero?
Calloc ( )function Both malloc () and calloc () None of the above malloc () function
Q.No:31 The function free () returns back the allocated memory got thorough calloc an malloc to .
stack heap stack and heap None of the given options
Q. No: 32 width() is member function of______
Cin object Cout object Both cin and cout object None of the given option
Q.No: 33 Templates are not type safe.
True False
Q.No:34 A Matrix can be composed of ints, floats or doubles as their elements. Best way is to handle this,
Write a separate class to handle each Use templates Use strings to store all types None
2
Q.No:35 In if structure the block of statements is executed only,
► When the condition is false
► When it contain arithmetic operators
► When it contain logical operators
►When the condition is true
Q.No:36 Header file: fstream.h includes the definition of the stream classes .
ifstream,fstream,cout ifstream, fstream, ofstream fstream,cin,cout None of the above
Q.No:37 To access the data members of structure is used.
dot operator (.) * Operator □operator None of given.
Q.No:38 eof (),bad(),good(),clear() all are manipulators.
True False
Q.No:39 which kind of functions can access private member variables of a class?
► Friend functions of the class
► Private member functions of the class
► Public member functions of the class
► Friend, private and public functions
Q.No:40 The return type of operator function must always be void.
True False
Q.No:41 Friend function of a class is .
Member function Non-member function Private function Public function
Q.No:42 Function implementation of friend function must be defined outside the class.
True False
Q.No:43 The normal source of cin object is,
File Disk Key board RAM
Q.No:44 Which of the following is correct way to initialize a variable x of int type with value10?
int x ;x=10; intx = 10; int x,x= 10; x=10;
Q.No:45 Consider the following code segment. What will be the output of the following program?
int func(int) ; int num=10 ;
int main(){int num ;num = 5 ; cout<<num;
cout<<func(num);}
intfunc(intx){ return num ;}
5, 5 10, 5 5, 10 10, 10
Q.No:46 with template function; the compiler automatically detects the passed data and generates a new
copy of function using passed data.
True False
Q.No:47 what will be the correct syntax to declare two-dimensional array of float data type?
floatarr {2}{2}; floatarr [2][2] ; floatarr [2,2]; float[2][2]arr;
Q.No:48 The first parameter of operator function for<<operator,
► Must be passed by value
►Must be passed by reference
► Can be passed by value or reference
► Must be object of class
Q.No:49 Heap is constantly changing in size.
True False
Q.No:50 While calling function, the arguments are assigned to the parameters from .
left to right. right to left no specific order is followed None of the given options.
3
Q.No:51 Classes defined inside other classes are called classes
looped nested overloade None of the given options.
d
Q.No:52 If we define an identifier with the statement #define PI3.1415926 then during the execution
of the program the value of PI .
Cannot be replaced None of the given options Remain constant. Can be changed by some operation
Q.No: 53 Which value is returned by the destructor of a class?
A pointer to the class. An object of the class.► A status code determining Destructors do not
whether the class was destructed return a value
correctly
Q.No:54 Every class contains .
Constructor Destructor Both a constructor and a destructor None of the given options
Q.No:55 A template function must have
One or more than one arguments ► Only one argument► Zero arguments None of the given options
Q.No:56 Structured Query Language is used for
Data bases Management► Networks ► Writing Operating System ► None of the given options
Q.No:57 when a call to a user-defined function finishes, the variable defined inside the function is still in
existence.
True False
Q.No:58 The precedence of an operator can be changed through operator overloading.
True False
Q.No:59 A Matrix can be composed of ints, floats or doubles as their elements.Bestway is to handle this,
Write a separate class to handle each Use templates ► Use strings to store all types None
Q.No:60 “delete" operator is used to return memory to free store, which is allocated by the "new "operator.
True False
Q.No:61 Pointer is a variable which store,
Data Memory Address Data Type Values
Q.No:62 All preprocess or directives are started with the symbol .
* + @ #
Q.No:63 Within the statement obj1=obj2;obj1 will call the assignment operator function and obj2
will be passed as an argument to function.
True False
Q.No:64 What is the sequence of event(s) when deal locating memory using delete operator?
► Only block of memory is deal located for objects
► Only destructor is called for objects
► Memory is deal located first before calling destructor
►Destructor is called first before deal locating memory
Q.No:65 The second parameter of operator functions for<< and>>are objects of the class for which we are
Over loading these operators.
True False
Q.No:66 To include code from the library in the program, such as iostream, a directive would be called up
using this command.
#include “iostream.h” include<iostream.h> include<iostream.h> #include<iostream.h>
Q.No:67 The number 544.53 must be stored in data type.
int short float char
Q.No:68 A template function can have different type of arguments.
True False
4
QuestionNo:9 (Marks:1)- Please choose one
Forwhichvaluesof theinteger_valuewillthefollowingcodebecomes aninfinite loop?

intnumber=1;
while (true) {
cout<< number;
if (number == 3) break;
number+=integer_value;}
► anynumberotherthan 1 or2
►only 0
► only1
► only2

QuestionNo:10 (Marks:1)- Please choose one


Templateclasscannothavestatic variables.

5
► True
► False
QuestionNo:11 (Marks:1)- Please choose one
Whichofthefollowingisused withbit manipulation?

► Signedinteger
►Un-signedinteger(Page245)
► Signeddouble
► Un-signeddouble

QuestionNo:12 (Marks:1)- Please choose one


Structureis acollection of underasingle name.

► Only Functions
►OnlyVariables(Page229)
► BothFunctionsand Variables
► Noneofthe givenoptions

QuestionNo:13 (Marks:1)- Please choose one


WhichofthefollowingisthecorrectC++syntaxtoallocatespacedynamicallyforanarrayof10 int?

► newint(10);
►newint[10];
► intnew(10);
► int new[10];

QuestionNo:14 (Marks:1)- Please choose one


Unary operator implemented as member function takes argumentswhereasnon-memberfunction
takes arguments.

► One,zero
►Zero,one
► One,two
► Two,one

QuestionNo:15 (Marks:1)- Please choose one


Thefirstparameterofoverloadedstreaminsertionoperatoris wheresecondparameteris

► inputstream,objectofclass
► objectofclass,output stream
►outputstream,objectofclass
► objectofclass,input stream

QuestionNo:16 (Marks:1)- Please choose one


Wecanalsodoconditionalcompilationwithpreprocessor directives.

►True(Page272)
► False
6
QuestionNo:17 (Marks:1)- Please choose one
Ifasymbolicconstanthasbeendefined,itwillbeanerrortodefineitagain.

►True(Page273)
► False

QuestionNo:18 (Marks:1)- Please choose one


Whilecallingfunction,theargumentsareassignedtotheparametersfrom .

►lefttoright.(Page295)
► righttoleft
► nospecificorderisfollowed
► noneofthegiven options.

QuestionNo:19 (Marks:1)- Please choose one


Classes defined inside other classes are called classes

► looped
►nested(Page492)
► overloaded
► noneofthe givenoptions.

QuestionNo:20 (Marks:1)- Please choose one


Ifwedefineanidentifierwiththestatement#definePI3.1415926thenduringtheexecutionoftheprogram the value
of PI .

► cannotbe replaced
► Noneofthe givenoptions
►Remainconstant.(Page271)
► canbe changedbysomeoperation

QuestionNo:21 (Marks:1)- Please choose one


Assignmentoperator is--------------------------associative.

► right
► left
► binary
► unary

QuestionNo:22 (Marks:1)- Please choose one


Iftextisapointerof classString thenwhatismeantbythe followingstatement?
text=new String[5];

► Createsanarrayof5stringobjectsstatically
►createsanarrayof5stringobjects dynamically
► Createsanarrayofpointerstostring
► CreatesastringObject

QuestionNo:23 (Marks:1)- Please choose one


7
The return type of the operator function for << operator is .

► classforwhichweoverloadoperator
► referenceofostreamclass(ostream&)
► referenceofistreamclass(istream&)
► void

QuestionNo:24 (Marks:1)- Please choose one


The code is written to theprogram.
►implement(Page520)
► design
► analysis
► noneofthe givenoptions.

QuestionNo:25 (Marks:1)- Please choose one


Memory allocated at run time is a system resource and it is the responsibility of tode-allocatethe
memory.
► System
►Programmer (Page331)
► Userof program
► Noneofgivenoptions

QuestionNo:26 (Marks:1)- Please choose one


Templatesarenottypesafe.

► True
►False(Page518)

QuestionNo:1 (Marks:1)- Please choose one


*.doc is bytype.
.
► SequentialFile
►RandomAccessFile
► DataFile
► RecordFile

QuestionNo:2 (Marks:1)- Please choose one


WhichofthefollowingisNOTapreprocessordirective?

► #error
► #define
► #line
►#ndefine(Page 2727)

QuestionNo:3 (Marks:1)- Please choose one


Thereturntypeofoperatorfunctionmustalways bevoid.

► True
►False(Page79)
8
QuestionNo:4 (Marks:1)- Please choose one
Whatdoes(*this)represents?

► Thecurrentfunction oftheclass
► Thecurrentpointeroftheclass
►Thecurrentobjectof theclass(Page390)
► Avalueofthedatamember

QuestionNo:5 (Marks:1)- Please choose one


Thestatementcin.get ();isusedto,

► Readastringfrom keyboard
►Readacharacterfromkeyboard(Page 426)
► Readastringfrom file
► Readacharacterfromfile

QuestionNo:6 (Marks:1)- Please choose one


Whenwedodynamicmemoryallocationintheconstructorofaclass,then itisnecessarytoprovidea destructor.

►True(Page479)
► False

QuestionNo:7 (Marks:1)- Please choose one


Overloadednewoperatorfunctiontakesparameter oftypesize_tandreturns

► void (nothing)
►voidpointer(Page415)
► objectpointer
► int pointer

QuestionNo:8 (Marks:1)- Please choose one


Thesecondparameterofoperatorfunctionsfor<<and>>areobjectsoftheclassforwhichweare overloading these
operators.

►True(Page453)
► False

QuestionNo:9 (Marks:1)- Please choose one


C++isacase-sensitive language

►True(Page68)
► False

QuestionNo:10 (Marks:1)- Please choose one


Toincludecodefromthelibraryintheprogram,suchasiostream,adirectivewouldbecalledupusingthis command.

► #include “iostream.h”
► include<iostream.h>
9
► include<iostream.h>
►#include<iostream.h>(Sure)

QuestionNo:11 (Marks:1)- Please choose one


Atemplatefunctionmusthaveonlygenericdatatypes.

► True
►False(Page501)

QuestionNo:12 (Marks:1)- Please choose one


Templateclasscannothavestaticvariables.

► True
► False

QuestionNo:13 (Marks:1)- Please choose one


Whatwillbethecorrectsyntax toassignanarraynamedarrof5elements toapointerptr?

►*ptr=arr;
► ptr=arr;
► *ptr=arr[5] ;
► ptr=arr[5];

QuestionNo:14 (Marks:1)- Please choose one


Whatwillbethecorrectsyntaxto accessthevalueoffourthelement ofanarrayusingpointerptr?

► ptr[3]
► (ptr+3)
► *(ptr+3)
►Both1and3

QuestionNo:15 (Marks:1)- Please choose one


Ifmostsignificantbitof un-signednumberis1thenitrepresentsapositive number.

► True
►False(Page251)

QuestionNo:16 (Marks:1)- Please choose one

If there is a symbol (& sign) used with the variable name followed by data type then it refers to and
if & is being used with variable name then it refers to .

► Addressofvariable,reference variable
► Referencevariable,valueof variable
►Referencevariable,addressofvariable(Page367)
► Addressofvariable,valueofvariable

QuestionNo:17 (Marks:1)- Please choose one


Wecanalsodoconditionalcompilationwithpreprocessor directives.
10
►True(Page272)
► False

QuestionNo:18 (Marks:1)- Please choose one


The default value of a parameter can be provided inside the

► functionprototype
► function definition
►bothfunctionprototypeorfunctiondefinition(Page294)
► noneofthe givenoptions.

QuestionNo:19 (Marks:1)- Please choose one


Classes defined inside other classes are called classes

► looped
►nested(Page492)
► overloaded
► noneofthe givenoptions.

QuestionNo:20 (Marks:1)- Please choose one


Whatpurposedoclassesserve?

► Dataencapsulation
► Providingaconvenientwayofmodelingreal-world objects
► Simplifyingcodereuse
►Allofthegiven options

QuestionNo:21 (Marks:1)- Please choose one


Every class contains .

► Constructor
► Destructor
►Bothaconstructorandadestructor(Lecture27)
► Noneofthe givenoptions

QuestionNo:22 (Marks:1)- Please choose one


new operatorisusedtoallocatememoryfromthe freestoreduring

CompileTime
►Run Time
► LinkTime
► Noneofthe givenoptions

QuestionNo:23 (Marks:1)- Please choose one


Whenanobjectofa classisdefinedinsideanotherclass then,

► Destructorof enclosingclasswillbecalledfirst
►Destructorofinnerobjectwillbecalledfirst
11
► Constructorand Destructorwillbecalledsimultaneously
► Noneofthe givenoptions

QuestionNo:24 (Marks:1)- Please choose one


Itispossibletodefine aclasswithinanother class.

►True(Page492)
► False

QuestionNo:25 (Marks:1)- Please choose one


New and Delete are also used with anddatatypesaswell.

►Class,Objects(Page342)
► Structures,Pointers
► BothClassandstructures
► Noneofabove

QuestionNo:26 (Marks:1)- Please choose one


WithNewkeyword,datatypesandclassmembersareinitializedwithmeaningfulvaluesinsteadof garbage.

►True(Page334)
► False

QuestionNo:1(Marks:1)- Please chooseone


If it isrequired tocopyanarraytoanotherarraythen,

►Botharraysmustbeof thesamesizeanddatatype(Page105)
► Botharraysmaybeofdifferent size
► Botharraysmaybeofdifferentdatatype
► Botharraysmaybeofdifferent sizeand type

QuestionNo:2 (Marks:1)- Please choose one


Dealingwithstructuresandfunctionspassingbyreferenceisthemosteconomical method

►True
► False
QuestionNo:3 (Marks:1)- Please choose one
eof(),bad(),good(),clear() allaremanipulators.

►True(Page433)
► False

QuestionNo:4 (Marks:1)- Please choose one


Overloadednewoperatorfunctiontakesparameter oftypesize_tandreturns

► void (nothing)
►voidpointer(Page415)
► objectpointer
► int pointer
12
QuestionNo:5 (Marks:1)- Please choose one
Whennewoperatorisoverloadedatgloballevelthencorrespondingbuilt-innewoperatorwillnotbe visible to
whole of the program.

►True(Page413)
► False

QuestionNo:6 (Marks:1)- Please choose one


Ifthereismorethanonestatementintheblockofaforloop,whichofthefollowingmustbeplaced atthe beginning and the
ending of the loop block?

► parentheses()
►braces{}(Page37)
► brackets[]
► arrows<>

QuestionNo:7 (Marks:1)- Please choose one


The return type of a function that do not return any value must be

► float
► int
►void(Page79)
► double

QuestionNo:8 (Marks:1)- Please choose one


UNIX has been developed in language.

► JAVA
►B
►C(Page12)
► FORTRAN

QuestionNo:9 (Marks:1)- Please choose one


Like member functions, canalsoaccesstheprivatedatamembersofa class.

► Non-memberfunctions
► Friendfunctions(Page 346)
► Anyfunctionoutsideclass
► Noneofthe givenoptions

QuestionNo:10 (Marks:1)- Please choose one


Whichofthefollowingstatementisbestregardingdeclarationoffriendfunction?

► Friendfunctionmustbedeclaredafterpublic keyword.
► Friendfunctionmustbedeclaredafterprivate keyword.
► Friendfunctionmustbedeclaredatthetopwithinclassdefinition.
►Itcanbedeclaredanywhereinclassasthesearenotaffectedbythepublicandprivatekeywords.
13
(Page 346)

QuestionNo:11 (Marks:1)- Please choose one


TheoperatorfunctionoverloadedforanAssignmentoperator(=)mustbe

► Non-memberfunctionofclass
► Memberfunctionofclass(Page372)
► Friendfunctionofclass
► Noneofthe givenoptions

QuestionNo:12 (Marks:1)- Please choose one


The endl and flush are

► Functions
► Operators
►Manipulators(Page434)
► Objects

QuestionNo:13 (Marks:1)- Please choose one


Ifasymbolicconstanthasbeendefined,itwillbeanerrortodefineitagain.

►True(Page273)15
► False

QuestionNo:14 (Marks:1)- Please choose one


The operator used for casting, in C, is standard operator.

► noneofthe givenoptions.
►cast(Page281)
► cost
► const

QuestionNo:15 (Marks:1)- Please choose one


Constructorscannotbeoverloadedlikeordinaryfunctions.

► True
►False(Page323)

QuestionNo:16 (Marks:1)- Please choose one


Whichofthefollowingfunctioncalliscorrectforthefunctionprototype?
defaultParameters ( int a, int b = 7, char z = ‘*’ );

►defaultParameters (5);
► defaultParameters(5,‘8’);
► defaultParameters(6,‘#’);
► defaultParameters(0,0,‘*’,0);

14
QuestionNo:17 (Marks:1)- Please choose one
WhenanoperatorfunctionisdefinedasmemberfunctionforabinaryPlus(+)operatorthenthenumberof argument it take
is/are.

► Zero
► One
►Two(Page371)
► Narguments

QuestionNo:18 (Marks:1)- Please choose one


Wecannotdefine avariableofuser-defineddata typeintheclass.

► True
►False(Page320)

QuestionNo:19 (Marks:1)- Please choose one


Whenanobjectofa classis definedinsideanotherclass then,

►Constructorofenclosingclasswillbecalledfirst(Page464)
► Constructorofinnerobjectwillbecalledfirst
► Constructorand Destructorwillbecalledsimultaneously
► Noneofthe givenoptions

15
QuestionNo:20 (Marks:1)- Please choose one
Theappropriatedatatypeto storethenumberofrows andcolums ofthematrixis .

► float
►int(Notsure)
► char
► noneofthe givenoptions.

QuestionNo:21 (Marks:1)- Please choose one


Classisauserdefined .

►datatype(page 317)
► memoryreferee
► value
► noneofthe givenoptions.

QuestionNo:22 (Marks:1)- Please choose one


Apointervariablecanbe,

► Decremented
► Incremented
► Multiplied
►BothIecrementedandDecremented(Page366)

QuestionNo:23 (Marks:1)- Please choose one

NULLvalue has been defined in and headerfiles.

► strings.hand iostream.h
► ctype.hand conio.c
► conio.candconio.h
►stdlib.handstddef.h(Page281)

QuestionNo:24 (Marks:1)- Please choose one

AMatrixcanbecomposedofints,floats ordoublesastheirelements.Bestwayis tohandlethis ,

► Writeaseparateclass tohandleeach
►Usetemplates(Page527)
► Usestringstostorealltypes
► Noneofthe givenoptions

QuestionNo:25 (Marks:1)- Please choose one


"setprecision"manipulatorwillset

16
►Thenumberof digitsafterthedecimalpoint(Page440)
► Thenumberofdigits beforethedecimal point
► Thenumberofdigitsinanumber
► Noneofthe givenoptions

QuestionNo:26 (Marks:1)- Please choose one


Whichofthefollowingoptionwillbetrue,ifweoverload"-="operator?

► only-operatorneeds tobe overloaded


► Minus(-)and=operatorsneedtobeoverloaded
►the-=operatorneedtobeoverloadedexplicitly
► the-and=operatorsneed tobeoverloaded implicitly

QuestionNo:1(Marks:1)-Pleasechooseone
In C/C++ifwe define anarrayofsize eight (8) i.e. int Arr [8];thenthelastelement ofthisarraywill bestored at,

► Arr[0]
► Arr[8]
► Arr[7]
► Arr[-1]

QuestionNo:2(Marks:1)-Pleasechooseone
Whenanarrayispassedtoa functionthen defaultwayofpassingthisarray is,

► Bydata
► Byreference(Page154)
► Byvalue
► Bydatatype

QuestionNo:3(Marks:1)-Pleasechooseone
Arrayisa data structure whichstore

► Memoryaddresses
► Variables
► DataType(Page100)
► Data

QuestionNo:4(Marks:1)-Pleasechooseone
Wecanalsocreateanarrayofuserdefinedatatype.

► True(Page408)
► False

17
QuestionNo:5(Marks:1)-Pleasechooseone
Whenwedefineanarrayofobjects then,

► Destructorwillcallonceforwholearray
► Destructorwillcallforeachobjectofthearray
► Destructorwillnevercall
► Dependsonthe sizeofarray

QuestionNo:6(Marks:1)-Pleasechooseone
Whatisthesequenceofevent(s)whenallocatingmemoryusingnewoperator?

► Onlyblockofmemoryisallocatedforobjects
► Onlyconstructoriscalledfor objects
► Memoryisallocatedfirstbeforecallingconstructor(Page414)
► Constructoriscalledfirstbeforeallocatingmemory

QuestionNo:7(Marks:1)-Pleasechooseone
We candeleteanarrayofobjectswithoutspecifying[]bracketsifa classisnotdoingdynamicmemory allocation internally.

► True
► False

QuestionNo:8(Marks:1)-Pleasechooseone
Thesecondparameterofoperatorfunctionsfor<<and>>areobjectsoftheclass For which
we are overloading these operators.

► True(Page453)
► False

QuestionNo:9(Marks:1)-Pleasechooseone
Whichofthefollowingiscorrectwaytoinitializeavariablexofinttypewith value 10?

► int x; x =10 ;
► intx = 10 ; (sure)
► int x, x =10;
► x =10 ;

QuestionNo:10(Marks:1)-Pleasechoose one
Default mechanism of function calling in case of array is andincaseof
variable is .

► Callbyvalue,callbyreference
► Callbyreferene,callbyreference
► Callbyreference,callbyvalue(Page119)
► Callbyvalue,callby value

QuestionNo:11(Marks:1)-Pleasechoose one
WhatdoesSTLstand for?
► Sourcetemplatelibrary

18
► Standardtemplatelibrary(Page519)
► Streamtemplatelibrary
► Standardtemporarylibrary

QuestionNo:12(Marks:1)-Pleasechoose one
Skill(s) thatis/are neededbyprogrammer’s .

► Payingattentiontodetail
► Thinkaboutthereusability
► Thinkaboutuserinterface
► Allof thegivenoptions(Page4&5)

QuestionNo:13(Marks:1)-Pleasechoose one
Forwhicharray,thesizeofthearrayshouldbeonemorethanthenumberof elements in an
array?

► int
► double
► float
► char(Page 113)

QuestionNo:14(Marks:1)-Pleasechoose one
new and delete are whereasmalloc and free are .

► Functions,operators
► Classes,operators
► Operators,functions(Page342-285)
► Operators,classes

QuestionNo:15(Marks:1)-Pleasechoose one
Friend functions are ofaclass.

► Memberfunctions
► Publicmember functions
► Privatememberfunctions
► Non-memberfunctions(Page346)

QuestionNo:16(Marks:1)-Pleasechoose one
The prototype of friend functions must be written theclassandits
definition must be written

► inside,insidetheclass
► inside,outsidetheclass(Page346)
► outside,insidetheclass
► outside,outsidetheclass

QuestionNo:17(Marks:1)-Pleasechoose one
Ifoverloadedplusoperatorisimplementedasnon-memberfunctionthenwhich of the
following statement will be true for the statement given below?
obj3=obj1+obj2;
► obj2willbepassedasanargumentto+operatorwhereasobj2will
19
drivethe +operator
► obj1willdrivethe+operatorwhereasobj2willbepassedasanargument to +
operator
► Bothobjects(obj1,obj2)willbepassedasargumentstothe+operator(not sure)
► Anyoftheobjects(obj1,obj2)candrivethe + operator

QuestionNo:18(Marks:1)-Pleasechoose one
Whichoneofthefollowingisthedeclarationofoverloadedpre-incrementoperatorimplementedasmember function?

► Class-nameoperator+();
► Class-nameoperator+(int);
► Class-nameoperator++(); (page389)
► Class-nameoperator++(int);

QuestionNo:19(Marks:1)-Pleasechoose one
For cin, the source isnormallya and destinationcan be .

► File,nativedatatype
► Disk,user-definetype
► Keyboard,variable(Page424)
Forcin,thesourceisnormallykeyboardandthedestinationcanbeanordinary variable

► File,user-definetype

QuestionNo:20(Marks:1)-Pleasechoose one
Wecanalsodoconditionalcompilationwithpreprocessordirectives.

► True(Page272)
► False

QuestionNo:21(Marks:1)-Pleasechoose one
Theprograms,inwhichweallocatestaticmemory,runessentiallyon

► Heap
► SystemCache
► Noneofthegivenoptions
► Stack(Page280)
Theprograms,inwhichweallocatestaticmemory,runessentiallyon stack.

QuestionNo:22(Marks:1)-Pleasechoose one
The defaultvalueofaparametercanbeprovidedinside the

► functionprototype
► functiondefinition(Page249)
► bothfunctionprototypeorfunction definition
► noneofthegivenoptions.

Thedefaultvalueofaparameterisprovidedinsidethefunctionprototypeorfunction definition.

QuestionNo:23(Marks:1)-Pleasechoose one

20
Whilecallingfunction,theargumentsareassignedtotheparametersfrom .

► lefttoright.(page 295)
► righttoleft
► nospecificorderisfollowed
► noneofthegivenoptions.

QuestionNo:24(Marks:1)-Pleasechoose one
WhenanoperatorfunctionisdefinedasmemberfunctionforabinaryPlus(+)operatorthenthenumberof argument it take
is/are.

► Zero
► One
► Two(Page 371)
► Narguments

QuestionNo:25(Marks:1)-Pleasechoose one
Withuser-defineddatatypevariables(Objects),selfassignmentcanproduce
.

► Syntaxerror
► Logicalerror
► Linkerror
► Nonof thegivenoptions(notsure)

QuestionNo:26(Marks:1)-Pleasechoose one
Assignmentoperatorisusedtoinitializeanewlydeclaredobjectfromexisting object.

► True(Page 479)
► False

QuestionNo:27(Marks:1)-Pleasechoose one
Whenanobjectofa classisdefinedinside anotherclass then,

► Constructorofenclosingclasswillbecalledfirst (Page496)
► Constructorofinnerobjectwillbecalledfirst
► ConstructorandDestructorwillbecalledsimultaneously
► Noneofthegivenoptions

QuestionNo:28(Marks:1)-Pleasechoose one
Inthememberinitializerlist,thedatamembersareinitialized,

► Fromleftto right
► Fromrighttoleft
► Inthe order inwhichtheyare definedwithinclass
► Noneofthegivenoptions

QuestionNo:29(Marks:1)-Pleasechoose one
newoperatorallocatesmemoryfromfree store andreturn .

21
► Apointer
► Areference
► Aninteger
► Afloat

QuestionNo:30(Marks:1)-Pleasechoose one
"new"and"delete" keywordsare inC++ language.

► Built-in-Function
► Operators
► MemoryAllocationFunction (Page332)
► Noneofthegivenoptions

QuestionNo:1(Marks:1)-Pleasechooseone
&&is operator.

► Anarithmetic
► Logical (Page 40)
► Relational
► Unary

QuestionNo:2(Marks:1)-Pleasechooseone
Whichofthefollowingfunction(s)is/areincludedinctype.hheaderfile?

► isdigit(intc)
► isxdigit(intc)
► tolower(intc)
► Allof the above (Page188)

QuestionNo:3(Marks:1)-Pleasechooseone
Disks are deviceshavingaccesstime of milliseconds.

► Electro-physical, 6
► Electro-Mechanical,4
► Electro-physical, 5
► Electro-Mechanical,7 (Page427)
http://www.tns.com/taocs_dp.asp

QuestionNo:5(Marks:1)-Pleasechooseone
Whenweusemanipulatorsinourprogramthenwhichheaderfileshouldbe included?

► iostream.h
► stdlib.h
► stdio.h
► iomanip.h (Page433)

QuestionNo:6(Marks:1)-Pleasechooseone
setprecisionisaparameterlessmanipulator.

22
► True
► False(Page 439)

QuestionNo:7(Marks:1)-Pleasechooseone
WhichofthefollowingisNOTapreprocessor directive?

► #error
► #define
► #line
► #ndefine(Page 272)

QuestionNo:8(Marks:1)-Pleasechooseone
Wecandoarithmeticwithreferenceslike pointers.

► True
► False(Page369)

QuestionNo:9(Marks:1)-Pleasechooseone
Whatdoes(*this)represents?

► Thecurrentfunctionofthe class
► Thecurrentpointerofthe class
► Thecurrentobjectoftheclass(Page390)
► Avalueofthedata member

QuestionNo:10(Marks:1)-Pleasechoose one
Friend function ofa classis .

► Memberfunction
► Non-memberfunction(Page348)
► Privatefunction
► Publicfunction

QuestionNo:11(Marks:1)-Pleasechoose one
Afunctioncandeclareitselfafriendofa class.

23
► True
► False (Page346)

QuestionNo:12(Marks:1)-Pleasechoose one
Overloadeddeleteoperatorfunctiontakesthesameparameterasanargument returned by
new operator function.

► True (Page 414)


► False

QuestionNo:13(Marks:1)-Pleasechoose one
Thesecondparameterofoperatorfunctionsfor<<and>>areobjectsoftheclass for
which we are overloading these operators.

► True (Page453)
► False
Thesecondparametertooperator<<isanobjectoftheclassthatweareoverloadingtheoperatorfor.Similar is the case
for operator >>

QuestionNo:15(Marks:1)-Pleasechoose one
Atemplatefunctionmusthaveonlygenericdatatypes.

► True
► False (Page501)

QuestionNo:16(Marks:1)-Pleasechoose one
Wecannotmakeamemberfunctionofaclassastemplate function.

► True
► False(Page506)

QuestionNo:17(Marks:1)-Pleasechoose one
Whichcharacterisinsertedattheendofstringtoindicatetheendofstring?

► newline
► tab
► null (Page113)
► carriagereturn

QuestionNo:18(Marks:1)-Pleasechoose one
is used for .

24
► calculation
► reading
► assigningvalueto variables (Page372)
► Noneofthegivenoptions.

QuestionNo:19(Marks:1)-Pleasechooseonevuzs
The object maybe usedbothforfileinputandfile output

► fstream, (Page 199)


► ifstream,
► ofstream,
► noneofthegivenoptions.

QuestionNo:20(Marks:1)-Pleasechoose one
Whichofthefollowingfunctioncallingmechanismistrueforthefunctionprototypegivenbelow?

floatfunc(float&);
► Callbyvalue
► Callbyreferenceusingpointer
► Callbyreferenceusingreference variable
► Noneofthegivenoptions

QuestionNo:21(Marks:1)-Pleasechoose one
Theprograms,inwhichweallocatestaticmemory,runessentiallyon

► Heap
► SystemCache
► Noneofthegivenoptions
► Stack (Page280)

QuestionNo:22(Marks:1)-Pleasechoose one
Overloadeddeleteoperatorfunctiontakesparameterofvoidpointerandreturns
.

► void
► voidpointer
► pointertoan object
► pointeroftype int

QuestionNo:23(Marks:1)-Pleasechoose one
Whatshouldbe thereturntype ofthe constructor?

► voidpointer
► int
► sameasobjecttype
► constructorsdonotreturnanything (Page313)

QuestionNo:24(Marks:1)-Pleasechoose one
Itisa wayofreusingthe code whenwecontainobjectsofouralreadywrittenclassesintoa new class,

► True
25
► False

QuestionNo:25(Marks:1)-Pleasechooseonevuzs
Templatesarenottype safe.

► true
► false(Page 518)

QuestionNo:26(Marks:1)-Pleasechoose one
The functionsusedfordynamic memoryallocationreturnpointeroftype

► int
► float
► void
► double

QuestionNo:1 (Marks:1)- Please choose one


Therearemainly--------------------------types of software

► Two (Page9)
► Three
► Four
► Five

QuestionNo:2 (Marks:1)- Please choose one


seekg() and write() are functionally .

► Different
► Identical
► Twonamesofsamefunction
► Noneoftheabove

QuestionNo:3 (Marks:1)- Please choose one

Whenapointeris incremented, it actuallyjumps thenumberofmemoryaddresses

►Accordingtodatatype(Page160)
► 1byte exactly
► 1bit exactly
► Apointervariablecannotbeincremented

QuestionNo:4 (Marks:1)- Please choose one


setwisaparameterizedmanipulator.

26
► True (Page437)
► False

QuestionNo:5 (Marks:1)- Please choose one


eof(),bad(),good(),clear() allaremanipulators.

►True(Page 433)
► False

QuestionNo:6 (Marks:1)- Please choose one


In functions that return reference, use variables.

► Local
► Global
►Globalorstatic(Page369)
► Noneofthe givenoption

QuestionNo:7 (Marks:1)- Please choose one


ThedeclaratorofPlus(+)memberoperatorfunction is

►Class-Nameoperator+(Class-Namerhs) (Page371)
► operatorClass-Name+( )
► operatorClass-Name+( rhs)
► Class-Nameoperator+()

QuestionNo:8 (Marks:1)- Please choose one


Thecompilerdoesnot provideacopyconstructorifwedonot provideit.

► True
► False (Page476)

QuestionNo:9 (Marks:1)- Please choose one


Whatisthefunctionalityofthefollowingsyntax todeletean arrayof5objectsnamedarrallocated using new
operator?
deletearr;

► Deletesalltheobjectsof array
►Deletesoneobjectofarray(Page411)
► Do not deleteanyobject
► Resultsintosyntax error
Thisstatementwillcallthedestructoronlyfortheobjectpointedbythearranddeallocatethespaceallocatedto this object

QuestionNo:10 (Marks:1)- Please choose one


Whatis thesequenceof event(s)whenallocating memoryusingnewoperator?

27
► Onlyblock ofmemoryis allocated for objects
► Onlyconstructor iscalledfor objects
►Memoryisallocatedfirstbeforecallingconstructor (Page414)
► Constructoriscalledfirstbeforeallocatingmemory
QuestionNo:11 (Marks:1)- Please choose one
Whatis thesequenceofevent(s)when deallocatingmemoryusingdeleteoperator?

► Onlyblockofmemoryisdeallocatedfor objects
► Onlydestructoriscalledforobjects
► Memoryisdeallocatedfirstbefore callingdestructor
►Destructoriscalledfirstbeforedeallocatingmemory(Page414)

QuestionNo:12 (Marks:1)- Please choose one


newanddeleteoperators cannotbeoverloaded as member functions.

► True
► False (Page414)

QuestionNo:13 (Marks:1)- Please choose one


Theoperatorfunctionof <<and >>operatorsare alwaysthememberfunctionofaclass.

► True
►False(Page 446)

QuestionNo:15 (Marks:1)- Please choose one


If wedo not mention anyreturn_value_typewith afunction, it will return an value.

► int (Page 79)


► void
► double
► float

QuestionNo:16 (Marks:1)- Please choose one


Supposeaprogramcontainsanarraydeclaredasintarr[100];whatwillbe thesizeofarray?

►0
► 99
► 100 (Page103)
► 101

28
QuestionNo:17 (Marks:1)- Please choose one
Thenameofanarrayrepresents address offirstlocation ofarrayelement.

► True
► False
The nameofthe arrayisa constantpointerwhichcontainsthememoryisthe addressoffirstelementofthe array

QuestionNo:18 (Marks:1)- Please choose one


Reusingthevariablesinprogram helpstosavethememory

► True
► False

QuestionNo:19 (Marks:1)- Please choose one


Whichofthefollowingoptionis trueabout newoperatorto dynamicallyallocatememoryto an object?

► Thenewoperator determinesthesizeofanobject
► Allocatesmemorytoobject andreturnspointerofvalidtype
► Createsanobject andcallstheconstructor toinitializethe object
►Allofthegiven options

QuestionNo:20 (Marks:1)- Please choose one


New and delete are whereas malloc and free are .

► Functions,operators
► Classes, operators
►Operators, functions (Page342-285)
► Operators,classes

QuestionNo:21 (Marks:1)- Please choose one


Like member functions, canalsoaccesstheprivatedatamembersofa class.

► Non-memberfunctions
►Friendfunctions (Page346)
► Anyfunction outsideclass
► Noneofthe givenoptions

QuestionNo:22 (Marks:1)- Please choose one


Whichofthefollowingstatementisbestregardingdeclarationoffriendfunction?

► Friendfunctionmustbedeclaredafterpublic keyword.
► Friendfunctionmustbedeclaredafterprivate keyword.
► Friendfunctionmustbedeclaredatthetopwithinclassdefinition.
►Itcanbedeclaredanywhereinclassasthesearenotaffectedbythepublicandprivatekeywords.
(Page 346)

29
QuestionNo:23 (Marks:1)- Please choose one
TheoperatorfunctionoverloadedforanAssignmentoperator(=)mustbe

► Non-memberfunctionofclass
► Memberfunctionof class (Page372)
► Friendfunctionofclass
► Noneofthe givenoptions

QuestionNo:24 (Marks:1)- Please choose one


Fornon-memberoperatorfunction, objectonleftsideoftheoperatormaybe

► Objectofoperatorclass
► Objectofdifferentclass
► Built-indatatype
► Allof thegiven options (Page375)

QuestionNo:25 (Marks:1)- Please choose one


The operator function will be implemented as ,ifobj1drivethe-operatorwhereasobj2ispassedas
arguments to - operator in the statement given below.
obj3=obj1-obj2;

►Memberfunction (Page373)
► Non-memberfunction
► Friendfunction
► Noneofthe givenoptions

QuestionNo:26 (Marks:1)- Please choose one


Whichoneofthefollowingisthedeclarationofoverloadedpre-incrementoperatorimplementedas member
function?

► Class-nameoperator+();
► Class-nameoperator+(int);
►Class-nameoperator++(); (Page389 )
► Class-nameoperator++(int);

QuestionNo:27 (Marks:1)- Please choose one


The static data members of a class are initialized

► atfile scope (Page466)


► withinclassdefinition
► withinmember function
► withinmainfunction

QuestionNo:28 (Marks:1)- Please choose one


Classisauserdefined .

►data type (Page317)


30
► memoryreferee
► value
► noneofthe givenoptions.

QuestionNo:29 (Marks:1)- Please choose one


Wecanalsodefineauser-definesmanipulators.

► True
► False
Parameterizedmanipulatorsrequireoneormorearguments.setfill(nearthebottom
oftheiomanip.hheaderfile)is an example of a parameterized manipulator. You can create your own
parameterized manipulators and your own simple manipulators.

QuestionNo:30 (Marks:1)- Please choose one


Automatic variable are created on .

► Heap
► Freestore
► static storage
► stack (Page461)

QuestionNo:1(Marks:1)-Pleasechooseone
IfNumisanintegervariablethenNum++means,

 Add1twotimeswithNum
 Add1 withNum
 Add2withNum
 Subtract2fromNum

QuestionNo:2(Marks:1)-Pleasechooseone
Ifthe returntype ofafunctionisvoidthenitmeansthatitwill,

 Returnanytypeofdata
 Returnsomespecifictypeofdata
 Returnnodata
 Returnjustcharacterdata
QuestionNo:3(Marks:1)-Pleasechooseone
Whichofthefollowingisavalidclass declaration?

 classA{ intx; };
 classB {}
 publicclassA{}
 objectA{intx;};

QuestionNo:4(Marks:1)-Pleasechooseone

31
Whenweusemanipulatorsinourprogramthenwhichheaderfileshouldbeincluded?

 iostream.h
 stdlib.h
 stdio.h
 iomanip.h (Page433)

QuestionNo:5(Marks:1)-Pleasechooseone
Wecanalsocreateanarrayofuserdefinedatatype.

 True (Page408)
 False

QuestionNo:6(Marks:1)-Pleasechooseone
Thenormalsourceofcinobjectis,

 File
 Disk
 Keyboard (Page 424)
 RAM

QuestionNo:7(Marks:1)-Pleasechooseone
Astreamisanorderedsequenceofbytes.

 True (Page423)
 False

QuestionNo:8(Marks:1)-Pleasechooseone
Whatisthesequenceofevent(s)whenallocatingmemoryusingnewoperator?

 Onlyblockofmemoryis allocatedfor objects


 Onlyconstructoriscalledforobjects
 Memoryisallocatedfirstbeforecalling constructor (Page414)
 Constructoriscalledfirstbeforeallocatingmemory

QuestionNo:9(Marks:1)-Pleasechooseone
We candeleteanarrayofobjectswithoutspecifying[]bracketsifa classisnotdoingdynamicmemory allocation
internally.

 True(Page 412)
 False
QuestionNo:10(Marks:1)-Pleasechoose one
Thesecondparameterofoperatorfunctionsfor<<and>>areobjectsoftheclassfor which
we are overloading these operators.

 True (Page453)
 False

QuestionNo:11(Marks:1)-Pleasechoose one
Whichloopingprocesschecksthetestconditionattheendoftheloop?

32
 for
 while
 dowhile
 no looping process checks the test condition at the end
http://mathbits.com/MathBits/CompSci/looping/MCLooping.htm

QuestionNo:12(Marks:1)-Pleasechoose one
Inagroupofnestedloops,whichloopisexecutedthemostnumberoftimes?

 theoutermostloop
 theinnermostloop
 allloopsareexecutedthesamenumberoftimes
 cannotbedeterminedwithoutknowingthesizeoftheloops
http://mathbits.com/mathbits/java/Looping/MCLooping.htm

QuestionNo:13(Marks:1)-Pleasechoose one
Templateclasscannothavestaticvariables.

 True
 False(Page 513)

QuestionNo:14(Marks:1)-Pleasechoose one
Considerthefollowingstatementstoinitializeatwo-dimensionalarray.

 intarr[2][3] ={4, 8,9,2,1, 6};


 intarr[3][2] ={4, 8,9,2,1, 6};
 intarr[][2]={{4,8},{9,2},{1,6}};

Whichofthefollowingoption(s)arecorrecttoinitializeatwo-dimensionalarray with 3 rows


and 2 columns?

 (ii) only
 (iii) only
 (ii)and (iii)
 and (iii)

QuestionNo:15(Marks:1)-Pleasechoose one
Thereisapointervariablenamedptroftypeintthenaddressofwhichtype ofvariabletheptrwillstoreinit?

 variableoftypechar
 variableoftypeshort
 variableoftypeint
 variableoftypedouble

QuestionNo:16(Marks:1)-Pleasechoose one
Letsuppose
UnionintorDouble{ I
nt ival;
Double charvar;
};
main(){
33
intorDoubleVAZ;
int size ;
size=sizeof(VAZ);
}
Whatwillbethevalueofvariable"size",ifintoccupies4bytesanddoubleoccupies8 bytes?

 2
 4
 8
 12

QuestionNo:17(Marks:1)-Pleasechoose one
new and delete are whereasmalloc and free are .

 Functions,operators
 Classes,operators
 Operators,functions (Page342-285)
 Operators,classes

QuestionNo:18(Marks:1)-Pleasechoose one
The memberfunctionsofa classoccupy region in memoryfor object(s)ofclass.

 separate,each
 common,all (Page334)
 different,each
 different,all

QuestionNo:19(Marks:1)-Pleasechoose one
Friend functions are ofaclass.

 Memberfunctions
 Publicmember functions
 Privatememberfunctions
 Non-memberfunctions (Page346)

QuestionNo:20(Marks:1)-Pleasechoose one
Whichofthefollowingistruewhileoverloadingoperators?

 Precedenceofanoperatorcanbechanged
 Thearity(numberofoperands)canbechanged
 Nonewoperatorscanbecreated
 Associativityofanoperatorcanbechanged

QuestionNo:21(Marks:1)-Pleasechoose one
Whichofthefollowingoptionwillbetruetooverloadthe-=operator?

 only-operator needstobeoverloaded(notsure)
 Minus(-)and=operatorsneedtobe overloaded
 the-=operatorneedtobeoverloadedexplicitly
 the-and=operatorsneedtobe overloadedimplicitly

34
QuestionNo:22(Marks:1)-Pleasechoose one
The input/outputstreams;cinandcoutare

 Operators
 Functions
 Objects
 Structures
QuestionNo:23(Marks:1)-Pleasechoose one
dec, hex, oct are all
 Memberfunctions
 Objectsofinput/output streams
 Parameterizedmanipulators
 Non-parameterizedmanipulators (Page435)
QuestionNo:24(Marks:1)-Pleasechoose one
Whatwillbetheoutputofthefollowingstatement? cout
<< setbase(16) << 52 ;

 74
 52
 34
 64
QuestionNo:25(Marks:1)-Pleasechoose one
Thefirstparameterofoverloadedstreaminsertionoperatoris where secondparameteris

 inputstream,objectofclass
 objectofclass,output stream
 outputstream,objectofclass
 objectofclass,input stream

QuestionNo:26(Marks:1)-Pleasechoose one
Wecanalsodoconditionalcompilationwithpreprocessordirectives.

 True (Page272)
 False

QuestionNo:27(Marks:1)-Pleasechoose one
Withuser-defineddatatypevariables(Objects),selfassignmentcanproduce .

 Syntaxerror
 Logicalerror
 Linkerror
 Nonofthegivenoptions

QuestionNo:28(Marks:1)-Pleasechoose one
The returntype ofthe operatorfunctionfor>>operatoris .

35
 classforwhichweoverloadthis operator
 referenceofostreamclass(ostream&)
 referenceofistreamclass(istream&)
 void

QuestionNo:29(Marks:1)-Pleasechoose one
Whenanobjectofa classisdefinedinside anotherclass then,

 Constructorofenclosingclasswillbecalledfirst (Page496)
 Constructorofinnerobjectwillbecalledfirst
 ConstructorandDestructorwillbecalledsimultaneously
 Noneofthegivenoptions

QuestionNo:30(Marks:1)-Pleasechoose one
Wherewecanincludeaheaderfileinthe program?

 anywhere (Page270)
 in start
 atthe end
 noneofthegivenoptions.

36

You might also like