Decision making statements

These statements are used to control the flow of execution of a program by making a decision depending on a condition, hence they are named as decision making statements. Decision making statements are of four types. Simple if if else nested if else If else ladder 1. Simple if Statement if the test expression is true then if statement executes statements that immediately follow if Syntax: Example: 2. if-else Statement If test expression is true block of statements following if are executed and if test expression is false then statements…

Read More

Conditional Control Statements

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: Statements may only be obeyed under certain conditions (conditionals) Statements may be obeyed repeatedly under certain conditions (loops) A group of remote statements may be obeyed (subroutines) Conditional Control Statements are divided in three types: Decision making statements Switch case control statement Loop control statements or repetitions It can actually be argued that…

Read More