If Else Statement in C Language
Updated on May 31, 2025 | By Learnzy Academy
The if...else statement in C is used to make decisions based on conditions. It allows the program to execute different blocks of code depending on whether a condition is true or false.
Example -
if (condition) {
// Code to execute if the condition is true
} else {
// Code to execute if the condition is false
}
Click here to download practice questions on
If Else StatementList of question on "If Else Statement"
- Use nested if to check if a triangle is equilateral, isosceles, or scalene.
- Check if a person can vote and also check if they are a senior citizen using nested if.
- Find Largest of Three Numbers using nested if
- Check if a number is positive, negative, or zero, and even/odd if positive.
- How to create BMI (Body Mass Index) Checker in C language ?
- Program in C to Check whether a year is a century year or not
- Program in C to Find the largest number among three numbers.
- Write a program in C to Check whether a character is uppercase or lowercase.
- Write a program in C to Check whether a number is divisible by 5 and 11
- Program in C to Check the type of character (Alphabet, Digit, Special).
- Grading System Based on Marks.
- Program in C to Check whether a year is a leap year or not.
- Write a program in C to Check if a person is eligible to vote by checking his or her age.
- Find the largest of two numbers entered by the user.
- Check if a number is positive or negative.
- Check if a given Number is Even or Odd.