a decision is a chain of ifs in which the statement associated with each else is an if the following syntax of else ladder condition.
if(condition1)
{
statement1;
}
else if(condition2)
{
statement2;
}
else if(condition3)
{
statement3;
}
else if(condition n)
{
statement n;
}
else
{
default statement;
}
#include<stdio.h>
#include<conio.h>
void main()
{
int y;
clrscr();
printf("Enter Year:");
scanf("%d",&y);
if(y%400==0)
{
printf("Leap Year");
}
elseif(y%100=0)
{
printf("Not Leap Year");
}
elseif(y%4==0)
{
printf("Leap Year");
}
else
{
printf("Not Leap Year");
}
getch();
}