12th class (Fsc) computer unit 12 MCQs
26. The part of for loop execute only one:
a. decrement
b. condition
c. initialization
d. increment
27. No. of expression in for loop statement are:
a. 6
b. 4
c. 5
d. 3
28. In for statement, the expression is executed only once:
a. Test
b. Validation
c. Condition
d. Initialization
29. What is the final value of x after executing the following code for (int x = 0; x < 10; x + +)?
a. 10
b. 8
c. 11
d. 9
30. If you want a user to enter exactly 20 values which loop would be the best to use?
a. Infinite
b. While
c. FOR
d. Do-while
31. Which one is the loop structure?
a. Switch
b. If
c. For
d. If-else
32. What is the final value of I after executing the following code for (int i=1; i<5; i+=2)?
a. 6
b. 7
c. 9
d. 5
33. ……… is a loop statement.
a. Switch
b. If
c. For
d. If-else
34. Which of the following is called counter loop?
a. For loop
b. Nested if – else
c. While loop
d. If – else
35. Which of the following loop is called counter loop?
a. Do-while
b. For
c. While
d. None
36. This loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop?
a. For
b. While
c. Nested
d. Do-while
37. A for statement contains three expressions: initialization, test and:
a. Increment/decrement
b. Null
c. None
d. Validation
38. In a For statement, this expression is executed only once:
a. Initialization
b. Test
c. Validation
d. None
39. This statement causes a loop to terminate early?
a. Break
b. Terminate
c. Exit
d. Both A & B
40. The loop which never ends is called:
a. Continuous loop
b. Infinite loop
c. Nested loop
d. Running loop
41. Which statement is used to move the control to the start of loop body?
a. Switch
b. Continue
c. Break
d. None
42. A special value that marks the end of a list of input data is called:
a. Loop control value
b. Terminal value
c. Input value
d. Sentinel value
43. loop within a loop is called:
a. Infinite
b. Complex
c. For
d. Nested
44. Which is a loop statement?
a. Switch
b. If
c. For
d. If else
45. A loop inside the body of another loop is:
a. Nested loop
b. For loop
c. Infinite loop
d. While loop
46. This statement may be used to stop a loop’s current iteration and begin next one:
a. Terminate
b. Continue
c. Break
d. None
Click here to go directly on chapter no.13