1 |
This statement causes a loop to terminate early? |
- A. Break
- B. Terminate
- C. Exit
- D. A and B
|
2 |
What is the value of "a" after execution the following code segment:<div>int a=2;</div><div>int b=0;</div><div>while(b<5)</div><div>{ a=a*2;</div><div> b=b+1;</div><div>}</div><div>a=a+1;</div> |
|
3 |
If we want a user to enter exactly 20 values, which loop would be the best to use? |
- A. While
- B. Do-while
- C. For
- D. Infinite
|
4 |
What is the final value of x after executing the following code:<div>For (int x=0; x<10; X++)</div> |
|
5 |
________ contains icon button that are shortcuts to the commands in the menu |
- A. Menu bar
- B. Tool bars
- C. Scroll bar
- D. Status bar
|
6 |
The keyword used to come out of the body of loop is |
- A. Exit
- B. Continue
- C. Break
- D. Ebd
|
7 |
When does the code block following while (x<100) execute? |
- A. When x is less then one hundred
- B. When x is greater then one hundred
- C. When x is equal to one hundred
- D. None
|
8 |
Which statement is used to move the control to the start of loop body? |
- A. Continue
- B. Break
- C. Switch
- D. Goto
|
9 |
A loop whose execute never ends is called |
- A. Nested loop
- B. Forever loop
- C. Infinite loop
- D. Counter loop
|
10 |
One execution of a loop is known as a(n): |
- A. Cycle
- B. Duration
- C. Iteration
- D. Test
|