8/14/2019 OnlineQuizCs201.doc
1/24
Online Quiz C++ Fall-2009Q1: ofstream is used for________
Input file stream
Output file stream
Input and output file stream
All of the givenQ2: Function prototype is written,
Within main function
After the return statement in main
Before the return statement in main
Before call of that function
Q: !AI" stands for__________________#
!edundant Array of Ine$pensive "ices
!edundant Array of Ine$perience "evices
Redundant Array of ne!pensi"e #e"ices
!educed Array of Ine$pensive "evices
Q%: If int sum & '%( )hen the value of the following statement is sum & sum * (
'2 '+
$%
'
Q': In while loop the loop counter must -e initiali.ed,
/ith in the loop
&efore enterin' the loop
At the end of the loop
0one of the given options
Q: omputer can understand only __________language code#
3igh level
4ow level
(achine Fourth generation
Q: )ranspose of a matri$ means that when we interchange rows and columns_____________
the first row -ecomes the 4ast column
the first ro) *ecomes the first column
the 4ast row -ecomes the first column
the first column -ecomes the first row
Q5: 4oops are _______________ 6tructure
"ecision
6e7uential
Repetition
0one of the given options
Q8: is widely 9nown as development language of _______ operating system# 4inu$
ni!
/indows
ac ;6
Q1+: In_________, we try to have a precise pro-lem statement
Analysis
"esign
oding
8/14/2019 OnlineQuizCs201.doc
2/24
0one of the given
Q11: _________ , >& , ? , ?& are called __________ operators#
Arithmetic
o'ical
!elational
onationalQ1%: the si.eof operator is used to determine the si.e of _____________#
data
varia-le
data type
.one of the 'i"en @orrect Answer is "elete operator
Q1': If int a & '+( then the value of a& ( will -e,
1'
15
%/
1
Q1: _______________are conventional names of the command line parameters of the Cmain@D
function# Carg-D and CargvD
ar'c1 and ar'"1
CargcD and CarguD
0one of the given
Q1: From following( which one is the correct synta$ of an array initiali.e: Array si.e is 1+ and it isof dou-le data type to value +E
arr1+G & H+#+(
dou-le arr1+G& +#+(
dou*le arr%03 4 506078
dou-le arrG & +#+(
Q15: ________ statement interrupts the flow of control#
switch continue
goto
*rea,
Q18: From the following( which one is used as an assignment operatorE
:ual si'n 41
"ou-le e7ual sign C&&D
Both e7ual and dou-le e7ual sign
0one of the given options
8/14/2019 OnlineQuizCs201.doc
3/24
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left73
sec(s)
Questio ! 1 of 10 " Start time: 06:06:0#
PM $Total Mar%s: 1
When a = 26; then the expression a%= 5; will calculate the value of a as,
Sele&t &orre&t o'tio:
1
3
5
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left75
sec(s)
Questio ! ( of 10 " Start time: 06:06:)4
PM $Total Mar%s: 1
!= , "= , #= , etc are calle$,
Sele&t &orre&t o'tio:
8/14/2019 OnlineQuizCs201.doc
4/24
ssi&n'ent operators
o&ical operator
o'poun$ assi&n'ent operator
*nar+ operator
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left67
sec(s)
Questio ! ) of 10 " Start time: 06:06:#6
PM $Total Mar%s: 1
ointers are a special t+pe of ----------in which a 'e'or+ a$$ress is store$
Sele&t &orre&t o'tio:
varia.les
ocation
haracters
/one of the &iven
8/14/2019 OnlineQuizCs201.doc
5/24
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left76
sec(s)
Questio ! 4 of 10 " Start time: 06:0*:(#
PM $Total Mar%s: 1
0he co$e of null character is-----------
Sele&t &orre&t o'tio:
1
111
11
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left74
sec(s)
Questio ! # of 10 " Start time: 06:0*:4#
PM $Total Mar%s: 1
---------------are conventional na'es of the co''an$ line para'eters of the 'ain()function
Sele&t &orre&t o'tio:
ar&. an$ ar&v
8/14/2019 OnlineQuizCs201.doc
6/24
ar&c an$ ar&v
ar&c an$ ar&u
/one of the &iven
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left28
sec(s)
Questio ! 6 of 10 " Start time: 06:08:0*
PM $Total Mar%s: 1
-------------------- 9eturns true if c is a $i&it or a letter an$ false otherwise
Sele&t &orre&t o'tio:
int isalpha( int c )
int isalnu'( int c )
int isx$i&it( int c )
int is$i&it( int c )
8/14/2019 OnlineQuizCs201.doc
7/24
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left51
sec(s)
Questio ! * of 10 " Start time: 06:09:11
PM $Total Mar%s: 1
we have opene$ a file strea' '+file for rea$in& (&ettin&), '+filetell& () &ives us the current&et position of the file pointer t returns a whole nu'.er of t+pe-----------
Sele&t &orre&t o'tio:
lon&
int
short
$ou.le
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left5:
sec(s)
Questio ! 8 of 10 " Start time: 06:09:#4
PM $Total Mar%s: 1
aile seecur)
Sele&t &orre&t o'tio:
forwar$ $irection
8/14/2019 OnlineQuizCs201.doc
8/24
.ac
8/14/2019 OnlineQuizCs201.doc
9/24
Quiz Start Time: 06:06 PMsec(s)
Questio ! 10 of 10 " Start time: 06:11:08
PM $
Total Mar%s: 1
is wi$el+ 12>44 C
0i'e eft 87sec(s)
Euestion G 1 of 1 ( tart ti'e> 12>44>38 C ) 0otal Car 1
is wi$el+
inux
*nix
Win$ows
Cac D
8/14/2019 OnlineQuizCs201.doc
10/24
2lic9 here to 6ave Answ er J :ove to 0e$t Question
A8484: > /i'ra Ea'ar
EuiF tart 0i'e> 12>44 C
0i'e eft 84sec(s)
Euestion G 2 of 1 ( tart ti'e> 12>45>17 C ) 0otal Car 1
t the-----------, we tr+ to .rea< up the pro.le' into functional units
elect correct option>
anal+sis phase
$esi&n phase
'ple'entation phase
/one of the &iven
2lic9 here to 6ave Answ er J :ove to 0e$t Question
A8484: > /i'ra Ea'ar
EuiF tart 0i'e> 12>44 C
0i'e eft
88sec(s)
Euestion G 3 of 1 ( tart ti'e> 12>46>28 C ) 0otal Car 1
While $evelopin& a pro&ra'; shoul$ we thin< a.out the user interface?
elect correct option>
Hes
/o
2lic9 here to 6ave Answ er J :ove to 0e$t Question
8/14/2019 OnlineQuizCs201.doc
11/24
A8484: > /i'ra Ea'ar
EuiF tart 0i'e> 12>44 C
0i'e eft 88sec(s)
Euestion G 4 of 1 ( tart ti'e> 12>47>2 C ) 0otal Car 1suppose we have int +I1J; 0o access the 4th ele'ent of the arra+ we write---------
elect correct option>
+I4J;
+I3J;
+I2J;
none of &iven
2lic9 here to 6ave Answ er J :ove to 0e$t Question
A8484: > /i'ra Ea'ar
EuiF tart 0i'e> 12>44 C
0i'e eft 88sec(s)
Euestion G 5 of 1 ( tart ti'e> 12>47>3: C ) 0otal Car 1
What will .e the result of arith'etic expression 5!25#5"5?elect correct option>
45
6
3
:
2lic9 here to 6ave Answ er J :ove to 0e$t Question
A8484: > /i'ra Ea'ar
EuiF tart 0i'e> 12>44 C
0i'e eft 88sec(s)
8/14/2019 OnlineQuizCs201.doc
12/24
Euestion G 6 of 1 ( tart ti'e> 12>48>1 C ) 0otal Car 1
0he strin& in the arra+ is ter'inate$ .+ a -------
elect correct option>
Fero
nil
null
one
2lic9 here to 6ave Answ er J :ove to 0e$t Question
A8484: > /i'ra Ea'ar
EuiF tart 0i'e> 12>44 C
0i'e eft 88
sec(s)
Euestion G 7 of 1 ( tart ti'e> 12>48>38 C ) 0otal Car 1
f an arra+ has 5 ele'ents, what is allowa.le ran&e of su.scripts?
elect correct option>
K 4:
1 K 4:
K 5
1 K 5
2lic9 here to 6ave Answ er J :ove to 0e$t Question
A8484: > /i'ra Ea'ar
EuiF tart 0i'e> 12>44 C
0i'e eft 81sec(s)
Euestion G 8 of 1 ( tart ti'e> 12>4:>34 C ) 0otal Car 1
Wh+ we use LcinL?
elect correct option>
0o sen$ $ata to printer
8/14/2019 OnlineQuizCs201.doc
13/24
0o rea$ $ata fro' 12>44 C
0i'e eft 8:sec(s)
Euestion G : of 1 ( tart ti'e> 12>5>28 C ) 0otal Car 1
---------operator uses the si&n M
elect correct option>
Aitwise D9
Nxclusive D9
/B Dperator
/D0 operator
2lic9 here to 6ave Answ er J :ove to 0e$t Question
Questio +o: 1 " Mar%s: 1 $ , Please &hoose oe-hat is the out'ut of the follo.i/ statemetint i = 25; $o O cout i " 2; P while (i Q 3 RR i S 1);
T 51 T 5 T 48 T errorQuestio +o: ( " Mar%s: 1 $ , Please &hoose oeWhat $oes U(7) evaluate to in $eci'al where U is a /D0 operator? T 7 T 8
8/14/2019 OnlineQuizCs201.doc
14/24
T : T 1Questio +o: ) " Mar%s: 1 $ , Please &hoose oe0he con$ition in while loop 'a+ contain lo&ical expression .ut not relational expression T 0rue T alseQuestio +o: 4 " Mar%s: 1 $ , Please &hoose oeearchin& is easier when an arra+ is alrea$+ sorte$
VVVVVVVTVVVVVVVVTVQuestio +o: # " Mar%s: 1 $ , Please &hoose oef an arra+ has 1 ele'ents, what is allowa.le ran&e of su.scripts?
VVVVVVVTV :: 1 :: 1 1 1Questio +o: 6 " Mar%s: 1 $ , Please &hoose oe-hat .ill e the 2alue of 3a ad 3 after e5e&uti/ the follo.i/ statemetsa = 3;. = a!!;
3, 4 4, 4 3, 3 4, 3Questio +o: * " Mar%s: 1 $ , Please &hoose oeWhat will .e the correct s+ntax to initialiFe all ele'ents of two$i'ensional arra+ tovalue ?
T int arrI2JI3J = O,P ;
T int arrI2JI3J = OOP,OPP ;
T int arrI2JI3J = OP,OP ;
T int arrI2JI3J = OP ;
8/14/2019 OnlineQuizCs201.doc
15/24
Questio +o: 8 " Mar%s: 1 $ , Please &hoose oeWhich of the followin& functionreturns the siFe of a strin& varia.le?
VVVVVVVTVstrlen&th()
VVVVVVVTVstrin&len()
VVVVVVVTVstrlen()
VVVVVVVTVstren&th()
Questio +o: 9 " Mar%s: 1 $ , Please &hoose oeWhat will .e the ran&e of nu'.ers &enerate$ .+ function ran$ () % :? to :
VVVVVVVTV1 to :
VVVVVVVTV to 8
VVVVVVVTV1 to 8
Questio +o: 10 " Mar%s: 1 $ , Please &hoose oeVVVVVVVVXYV
VVVVVVVTVVVVVVVVTVVVVVVVVTVVVVVVVVTVZQuestio +o: 11 " Mar%s: 1 $ , Please &hoose oeo'puter can un$erstan$ onl+ 'achine lan&ua&e co$e
Questio +o: 1( " Mar%s: 1 $ , Please &hoose oeVVV!VV"V##VV$$$$$$$V#V[
VVVVVVVTV%VVVVVVVTV
8/14/2019 OnlineQuizCs201.doc
16/24
VVVVVVVTV&VVVVVVVTV'V()Questio +o: 1) " Mar%s: 1 $ , Please &hoose oe
What $oes 5 M 6 , evaluate to in $eci'al where M is Nxclusive D9 operator?
VVVVVVVTV\VVVVVVVTVVVVVVVVTVVVVVVVVTVQuestio +o: 14 " Mar%s: 1 $ , Please &hoose oef the file is not properl+ close$ in the pro&ra', the pro&ra' ------------
VVVVVVVTV0er'inate nor'all+VVVVVVVTVn$icate 9unti'e errorVVVVVVVTVn$icate o'pile ti'e errorVVVVVVVTVrashesQuestio +o: 1# " Mar%s: 1 $ , Please &hoose oeWhich of the followin& hea$er file inclu$e strin& conversion functions?
VVVVVVVTVstrin&hVVVVVVVTVst$li.hVVVVVVVTVct+peh
VVVVVVVTVsconverthQuestio +o: 16 " Mar%s: 1 $ , Please &hoose oen ro&ra' co''entin& the co$e li.erall+ is
VVVVVVVTV&VVVVVVVTVV#VVVVVVVTV*VVVVVVVVTV'VQuestio +o: 1* " Mar%s: 1 $
Which hea$er file 'ust .e inclu$e$ while han$lin& files?
Questio +o: 18 " Mar%s: 1 $
What is 'eant .+ !! state'ent> &ost it 'tr 7 5
Questio +o: 19 " Mar%s: ( $
What is a truth 0a.le?
8/14/2019 OnlineQuizCs201.doc
17/24
Questio +o: (0 " Mar%s: ) $
"i$n arra+ $a+is $eclare$ as> it da;< 7 =1> (> )> 4> #> 6> *?
ow 'an+ ele'ents $oes arra+ ]$a+] has?
"ii$f the $eclaration is chan&e$ as> it da;*< 7 =1> (> )> 4> #> 6> *?
ow 'an+ ele'ents $oes arra+ ]$a+] has?
Questio +o: (1 " Mar%s: # $
What are si'ilarities an$ $ifferences .etween tructures an$ *nions?
Questio +o: (( " Mar%s: 10 $
Write a 2oid fu&tio" $ that ta
8/14/2019 OnlineQuizCs201.doc
18/24
3
5
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left75
sec(s)
Questio ! ( of 10 " Start time: 06:06:)4
PM $Total Mar%s: 1
!= , "= , #= , etc are calle$,
Sele&t &orre&t o'tio:
ssi&n'ent operators
o&ical operator
o'poun$ assi&n'ent operator
*nar+ operator
8/14/2019 OnlineQuizCs201.doc
19/24
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left67
sec(s)
Questio ! ) of 10 " Start time: 06:06:#6
PM $Total Mar%s: 1
ointers are a special t+pe of ----------in which a 'e'or+ a$$ress is store$
Sele&t &orre&t o'tio:
varia.les
ocation
haracters
/one of the &iven
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left76
sec(s)
Questio ! 4 of 10 " Start time: 06:0*:(#
PM $Total Mar%s: 1
0he co$e of null character is-----------
Sele&t &orre&t o'tio:
8/14/2019 OnlineQuizCs201.doc
20/24
1
111
11
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left74
sec(s)
Questio ! # of 10 " Start time: 06:0*:4#
PM $Total Mar%s: 1
---------------are conventional na'es of the co''an$ line para'eters of the 'ain()function
Sele&t &orre&t o'tio:
ar&. an$ ar&v
ar&c an$ ar&v
ar&c an$ ar&u
/one of the &iven
MC090408110 : Usama KhalidTime Left
28sec(s)
8/14/2019 OnlineQuizCs201.doc
21/24
Quiz Start Time: 06:06 PM
Questio ! 6 of 10 " Start time: 06:08:0*
PM $Total Mar%s: 1
-------------------- 9eturns true if c is a $i&it or a letter an$ false otherwise
Sele&t &orre&t o'tio:
int isalpha( int c )
int isalnu'( int c )
int isx$i&it( int c )
int is$i&it( int c )
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left
51sec(s)
Questio ! * of 10 " Start time: 06:09:11
PM $Total Mar%s: 1
we have opene$ a file strea' '+file for rea$in& (&ettin&), '+filetell& () &ives us the current&et position of the file pointer t returns a whole nu'.er of t+pe-----------
Sele&t &orre&t o'tio:
lon&
8/14/2019 OnlineQuizCs201.doc
22/24
int
short
$ou.le
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left5:
sec(s)
Questio ! 8 of 10 " Start time: 06:09:#4
PM $Total Mar%s: 1
aile seecur)
Sele&t &orre&t o'tio:
forwar$ $irection
.ac
8/14/2019 OnlineQuizCs201.doc
23/24
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left52
sec(s)
Questio ! 9 of 10 " Start time: 06:10:(*
PM $Total Mar%s: 1
Which of the followin& is true a.out strea's? t is a se@uence of .+tes A t is an or$ere$se@uence ll .+tes can &o throu&h the strea' si'ultaneousl+ B A+tes that enters first intothe strea' will &o out at last
Sele&t &orre&t o'tio:
onl+
onl+
an$ A
an$ B
MC090408110 : Usama Khalid
Quiz Start Time: 06:06 PM
Time Left8
sec(s)
Questio ! 10 of 10 " Start time: 06:11:08
PM $ Total Mar%s: 1
is wi$el+
8/14/2019 OnlineQuizCs201.doc
24/24
*nix
Win$ows
Cac D