ch2
ch2
Chapter 2nd
Control Statements
Q:1 Objective Type Multiple Choice Questions:
1. Which of the following statement is also called as conditional statement?
a. for b. break c. if d. while
2. switch-case is similar to statement
a. if else b. if else if c. break d. goto
3. Which statement can be used to terminate a case in the switch statement?
a. continue b. goto c. if d. break
4. Which of the following is an example of Post Test loop?
a. for b. while c. do while d. continue
5. Which of the following is not a jumping statement?
a. while b. continue c. goto d. break
1|Page
12th Class Computer Science (Session 2023-24)
Q:4 What is if-else statement? Write a program of if-else statement?
Ans: if else statement is a branching statement. It is used for decision making purpose in the C
programs. Following program shows the usage of if else statement:
Q:2 What is for loop? What are the two different categories of loops?
Ans: Looping statements are also called Iterative Statements. Sometimes we face situations that
require repeated exection of statements in the program. In such situtaions, loops help us to repeat
statements in the program. Loops can be categorized into
following two types:
Pre-Test Loops: Pre-Test loops are also called Entry-
Controlled loops. In these loops, test condition is
tested before the body of the loop. ‘for’ and ‘while’
loops are the examples of pre-test loops.
Post-Test Loops: Post-Test loops are also called Exit-
Controlled loops. In these loops, test condition is
tested after the body of the loop. ‘do while’ loop is an
example of post-test loop.
2|Page
12th Class Computer Science (Session 2023-24)
3|Page