ECAT Computer Science Chapter 11 Loops Online Test With Answers

image
image
image

ECAT Computer Science Chapter 11 Loops Online Test

Sr. # Questions Answers Choice
1 What is the final value of x after executing the following code:
for (int x=0; x<10;x++)
10 9 0 1
2 When does the code block following while (x<100) execute? When x is less than one hundred When x is greater than hundred When x is equal to hundred None
3 The body of for loop with single statement ends with: Right Bracket ] Right brace } Comma , Semi-colon ;
4 The body of while loop with multiple statements ends with: Right bracket 1 Right brace } Comma , Semi-colon ;
5 When is for loop more appropriate than while loop? The terminating condition occurs unexpectedly The body of loop will be executed at leas once The program will be executed at least once The number of times the loop will be executed is known before the loop executes
6 When is for loop more appropriate than while loop? The termination condition is known in advance The number of iteration is not known in advance The loop should be executed only once The loop should be executed at least once
7 Which of the following is a loop statement? If If else Switch None
8 Semicolon is placed at the end of condition in: While loop Do-while loop For loop All
9 While loop is also called: Conditional loop Wend loop Counter loop Continuous loop
10 While loop is also called: Conditional loop Wend loop Counter loop Continuous loop
11 If you want a user to enter exactly 20 values, which loop would be the best to use? While Do-while For Infinite
12 This means to increase a value by one: Modulus Increment Decrement Inc
13 This statement maybe used to stop a loop's current iteration and begin next one: Continue Break Terminate Next
14 In a for statement, this expression is executed only once: Test Validation Initialization All
15 A for statement contains three expressions: Initialization, test and: Assignment Validation Increment, decrement Recalling
Download This Set