In which sequence while loop is executed
a) body, initialization, testing
b) testing, initialization, body
c) initialization, testing, body
d) initialization body, testing
A while loop is more appropriate than for loop…..
a) body executed only once
b) termination condition occurs unexpectedly
c) program executes at least once
d) number of iterations are known
Which condition does…. while loop is more appropriate to use?
a) body of loop executed only once
b) loop terminates unexpectedly
c) program executes only once
d) number of iterations is known
Which condition for loop is more appropriate?
a) loop executes at least once
b) loop terminates unexpectedly
c) program executes at least once
d) iteration is known
A loop exit condition must….
a) be last instruction in body
b) evaluate to true or false
c) first instruction in body
d) not use compound condition
What is missing in the following code?
int loopCount;
while(loopCount<=5) {cout<<” Hi”;}
a) initialization of loop
b) testing of loop
c) incrementing of loop
d) nothing is missing