English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Explain the control statement with a suitable example. - Computer Science

Advertisements
Advertisements

Question

Explain the control statement with a suitable example.

Answer in Brief

Solution

Control statements are statements that alter the sequence of flow of instructions.
In a program, statements may be executed sequentially, selectively, or iteratively. Every programming language provides statements to support sequence, selection (branching), and iteration.
Selection statement:

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

The iteration statement is a set of the statement are repetitively executed depends upon conditions. If a condition evaluates to true, the set of statements (true block) is executed again and again. As soon as the condition becomes false, the repetition stops. This is also known as a looping statement or iteration statement.

shaalaa.com
  Is there an error in this question or solution?
Chapter 10: Flow of Control - Evaluation - Section - D [Page 178]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 10 Flow of Control
Evaluation - Section - D | Q 1. | Page 178
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×