If else Statement

Last Updated Nov 4, 2015, 07:00:14 PM

If else statement in c a an extention to if condition , meaning, if the given condition is not met, then it will execute the other statement

For example, if a student get more than 40 marks in EXAM, print the result as PASSED, otherwise (if else) print the result as FAILED

c decision making


Example of C If Statement

Try It Now

In the above if else statement example, first it checks if the initial condition is met or not. Meaning, if marks are less than 40? it prints the result as FAILED otherwise it prints the result as PASSED.

Other Decision Making Topics you might want to learn

If Statement in C

Nested If Statements in C

Switch Statement in C