Search This Blog

Monday, 13 December 2021

UNIT 04. CONTROL STRUCTURE - MCQs - Computer Science For Class X

GO TO INDEX

Computer Science For Class X
Unit 04: Control Structure
Multiple Choice Questions And Fill In The Blanks

By Mrs. Ayesha Arif
Vice Principal
(Jauhar Progressive School)


Multiple Choice Questions (MCQs)
Encircle the correct answer:
1. Loop within a loop is called ________ loop.
a. Inner
b. outer
c. enclosed
d. nested ✓

2. Case and _______ are also part of switch statement.
a. have
b. default ✓
c. for
d. if

3. “For” loop expression has ________ parts.
a. one
b. two
c. three ✓
d. four

4. exit( ) function is used to ___________.
a. close function
b. close loop
c. close program ✓
d. close switch

5. “continue ” statement takes control to the __________ .
a. top of loop ✓
b. end of loop
c. top of function
d. end of function

6. In “goto” statement label is followed by __________ character.
a. colon (:) ✓
b. semi colon (;)
c. single quote (‘)
d. double quote (“)

7. To send value to calling function we use ____________ statement.
a. throw
b. return ✓
c. send
d. back

8. “break” statement is used with _________ .
a. if
b. switch ✓
c. for
d. while

9. Using “else” is _________ with “if” statement.
a. prohibited
b. advised
c. compulsory
d. optional ✓

10. “if” and loop expressions use ___________ operators to test condition.
a. arithmetic
b. relational ✓
c. insertion
d. bitwise

11. C++ has _________ types of control statements.
a. one
b. two
c. three ✓
d. four

12. C++ has __________ decision making structures.
a. one
b. two
c. three ✓
d. four

13. __________ allows us to execute a statement several number of times.
a. if-else
b. loop ✓
c. switch
d. insertion

14. do while loop is similar to _________ loop.
a. if-else
b. while ✓
c. for
d. nested

15. If a loop exist in the body of another loop then it is called _____ .
a. if-else
b. while
c. for
d. nested ✓

16. A _________ statement causes the loop to skip the remaining statements of its body.
a. continue ✓
b. goto
c. return
d. nested

17. A _________ statement jumps or transfers control unconditionally from the goto to a labelled statement.
a. if-else
b. goto ✓
c. return
d. continue

18. A __________ program is the set of instructions in sequential form.
a. nested
b. computer ✓
c. control
d. return

19. ________ statement is the basic decision statement.
a. if ✓
b. break
c. if-else
d. continue

20. ________ statement change execution of program from its normal sequence.
a. if
b. jump ✓
c. for
d. goto

Fill In The Blanks:
1. A computer program is the set of instructions in sequential form.
2. Control statement are used to control the direction of program.
3. C++ has three types of control statements: Selection/Decision Making Structure, Iteration / Loops and Jump.
4. C++ has three decision making structures; 'if' statement, 'if-else statement and 'switch' statement.
5. "if" statement and "if-else" statements checks a condition.
6. "if" statement is the basic decision statement.
7. In "if" and "if-else" statement, if the condition is true the statements in if block are executes.
8. In "if" staement, if the condition is false, it leaves the statements in if block and starts executing statements after the block.
9. In case "if-else" staement is false, it executes statements in 'else block.
10. Switch statement checks different constants after case statement with switch variable.
11. If switch variable matches it executes statements after switch.
12. If switch variable does not match with any of the case constant control goes to default statement if present.
13. Loops allow us to execute a statement or a group of statements several numbers of times.
14. "for" loop execute a sequence of statements multiple times.
15. "for" loop is usually used in situations where at the start of loop we know that how many times loop body will execute.
16. Condition is tested at the start of loop.
17. "while" loop is a pre-test loop.
18. "while" loop tests the condition at start of loop and is usually used in situations where at the start of loop we do not know that how many times loop block will execute.
19. "while" loop is also called indefinite repetition loop.
20. "do while" loop is similar to "while" loop, except that it tests the condition at the end of the loop body.
21. "do while" loop is also called post-test loop.
22. "do while" loop's statements block is executed at least one time.
23. A "break" statement terminates the loop or switch statement and transfers control to the statement immediately following the loop or switch statement.
24. A "continue" statement causes the loop to skip the remaining statements of its body and immediately transfers control to the top of the loop.
25. A "goto" statement jumps or transfers control unconditionally from the "goto" to a labeled statement in the same function.
26. A "return" statement terminates the execution of a function and transfers program control to the statement just after the function call statement in the calling function.
27. The exit is used to terminate a C++ program.

Source: Special Thanks To Sir Syed Arif Ali


No comments:

Post a Comment