Posts

Showing posts with the label If-else if ladder statement

THE DECISION CONTROL STRUCTURE

Image
C language must be able to perform different set of actions depending on the circumstances.Here comes the importance of decision control structures. Decision making is about deciding the order of the execution of statements based on certain conditions.This decision control instruction can be implemented in C using : The if statement The if  statement may be implemented in different forms depending on the complexity of conditions to be tested. The different forms are, Simple if   statement if else  statement Nested if  statement if else ladder statement Simple if statement The general syntax of simple if statement is if(boolean_expression) { /* statement(s) will execute if the boolean expression is true */ } If the Boolean expression evaluates to  true , then the block of code inside the i f statement will be executed. If the Boolean expression evaluates to  false , then the first set of code after the end of the...