Posts

Showing posts with the label programming

Decision Making statements in C Programming

Decision-Making statements in C Programming In this tutorial, we will study decision-making statements in c, the if statement, else statement, and the if-else statement. What are the decision-making statements? Decision Making can be understood by using an example, the age of the student is stored in two-variables but if we want to print the age of the student we can use the decision-making statements (if, if-else, else if, Switch) in this situation. What are if statements? The If statement uses the curly braces { } for defining the block. If the condition is true then the statement inside the block is executed. And if the condition is false then the compiler skips the statements inside the block. The if statement can be used as many times as we want to. if(condition) { /* Statements */ } What are the if-else statements? It is similar to the if statement but in this, the else block is added and the else is executed when the condition in the if is false. The If-Else Statement defines ri