Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
16.6k views
in Flow of Control by (49.1k points)
closed by

Explain control statement with suitable example.

1 Answer

+1 vote
by (54.8k points)
selected by
 
Best answer

Control statements are statements that alter the sequence of flow of instructions.

Types of control statements:

1. Selection statement: The selection statement means the statement (s) executed, depends upon a condition. If a condition is true, a true block (a set of statements) is executed otherwise a false block is executed. This statement is also called decision statement or selection statement because it helps in making decision about which set of statements are to be executed.

Example:

1. If

2. Switch

2. Iteration (or looping) statement:

An iteration (or loop) is a sequence of one or more statements that are repeatedly executed until a condition is satisfied. These statements are also called as control flow statements. It is used to reduce the length of code to reduce the time to execute program and takes less memory space.

Example:

1. While

2. do ….. while

3. for

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...