Usually a program is not a linear sequence of instructions. It may repeat code or take decisions for a given path-goal relation. Most programming languages have control flow statements (constructs) which provide some sort of control structures that serve to specify order to what has to be done to perform our program that allow variations in this sequential order.The flow of execution of statements in a program is called as control. Control statement is a statement which controls flow of execution of the program. Control statements are classified into following categories.
statements ensures that the instructions(or statements) are executed in the same order in which they appear in the program. i.e. By default system executes the statements in the program in sequential order.
A conditional is a statement that instructs the computer to execute a certain block of code or alter certain data only if a specific condition has been met. Statements that are executed when a condition is true. These statements are divided into three categories.
- Decision making statements
- Switch case control statement or
- Loop control statements or repetitions
Statements that transfers control from on part of the program to another part unconditionally are called unconditional control statements.