Decision Making in C (if , if..else, Nested if, if-else-if )
Decision Making in C (if , if..else, Nested if, if-else-if ) The conditional statements (also known as decision control structures) such as if, if else, switch, etc. are used for decision-making purposes in C programs. They are also known as Decision-Making Statements and are used to evaluate one or more conditions and make the decision whether to execute a set of statements or not. These decision-making statements in programming languages decide the direction of the flow of program execution. Following are the decision-making statements available in C:if Statement if-else Statement Nested if Statement if-else-if Ladder switch Statement Conditional Operator Jump Statements: break continue goto return Let’s discuss each of them one by one. 1. if in C The if statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not i.e if a certain condition is true then a block of statements is executed other