If (condition) Program statement 1; Else Program statement 2;The if else is actually just on extension of the general format of if statement. If the result of the condition is true, then program statement 1 is executed, otherwise program statement 2 will be executed.
#include ' stdio.h ' void main ( ) { int num; printf (“Enter the number”); scanf (“%d”, &num); if (num < 0) // check whether number is less than //zero. printf (“The number is negative”) //result if true else // else statement. printf (“The number is positive”); //result if false }