C if-else Statement
The if-else statement in C is used to perform the operations based on some specific condition. The operations specified in if block are executed if and only if the given condition is true.
There are the following variants of if statement in C language.
- If statement
- If-else statement
- If else-if ladder
- Nested if
If Statement
The if statement is used to check some given condition and perform some operations depending upon the correctness of that condition. It is mostly used in the scenario where we need to perform the different operations for the different conditions. The syntax of the if statement is given below.
Flowchart of if statement in C

Let's see a simple example of C language if statement.
Output
Enter a number:4 4 is even number enter a number:5
Program to find the largest number of the three.
Output
Enter three numbers?
12 23 34
34 is largest