C Language



Admission Enquiry Form

  

If Else Statement in C


What is If...Else statement in C?

If...Else is conditional statement in C.

Syntax of If...Else statement...

if(condition)
{
//number of statements
}
else
{
//number of statements
}



Example of IF...Else statement:


Output:

Enter a number 11
Thanks to join Compuhelp

Enter a number 10
Welcome to Compuhelp

In the above example, if the user enters 11 then Else block will be executed, if user enters 10 then the Else block will be executed.