Hello friends!!!!!
If-Else statement
C LANGUAGE
10/8/20241 min read
The if-else statement is used to perform two operations for a single operation. The if-else statement is an extension to the if statement using which, we can perform two different operations, i.e., one is for the correctness for that condition, and the other is for the incorrectness of the condition. Here, we must notice that if and else block cannot be executed simultaneously. Using if-else statement is always preferable since it always invokes an otherwise case with every if condition. The syntax of the if-else statement is given below.
Syntax :
if(expression) {
//code to be executed if the expression is true
}
else {
//code to be executed if condition is false
}