In C programming language if else statements can be used to make decisions on which task
needs to be performed.
For example, the following code uses if else statement to print some messages.
#include<stdio.h>
int main(){
int x = 2;
if(x==2){
printf("If block of code executed\n");
}
else{
printf("else block of code executed\n");
}
}
Comments
Leave a comment