Page 92 - 2502_Pakistan-kifayat_C-7
P. 92
Choose the correct option.
1. What does a loop allow a program to do?
a. Stop all instructions b. Repeat a set of instructions
c. Perform different tasks at once d. Finish the program early
2. Which of the following is an example of a finite loop?
a. A fan keeps rotating
b. A robot moves forward again and again without stopping
c. A robot claps 5 times and then stops
d. Music plays forever in the background
3. Which of the following is the result of a condition in a program?
a. Number or word b. Always True
c. Always False d. Either True or False
4. In an if-then-else condition, what happens if the condition is false?
a. Nothing happens b. The else block runs
c. The if block runs d. The program stops
5. Which of the following should a good algorithm include?
a. Fancy words b. Clear and step-by-step instructions
c. Difficult language d. Only pictures
Tick ( ) the correct statements and cross ( ) the wrong ones.
1. The if-then-else statement is the simplest conditional statement.
2. An algorithm refers to a section of code that is grouped together.
3. The if statement gives a result only when the condition is true.
4. Logical reasoning helps to predict outputs for different inputs.
5. A finite loop runs forever until stopped manually.
Q Answer the following questions:
A
1. What is a loop?
2. Differentiate between finite and infinite loop.
90 Premium Edition-VII

