write a c program to check leap year or not,c program to check leap year using logical operators,c program to check leap year using function,c program to find leap year or not using conditional operator,c program to find leap year using if else,c program for leap year using nested if
#include"stdio.h"
#include"conio.h"
void main()
{
int year;
clrscr();
printf("Enter the year=");
scanf("%d",&year);
if(year%400==0)
{
printf("\n\n%d is leap year.",year);
}
else if(year%100==0)
{
printf("\n\n%d is not leap year.",year);
}
else if(year%4==0)
{
printf("\n %d is a leap year.",year);
}
else
{
printf("\n %d is not a leap year,",year);
}
getch();
}
#include"conio.h"
void main()
{
int year;
clrscr();
printf("Enter the year=");
scanf("%d",&year);
if(year%400==0)
{
printf("\n\n%d is leap year.",year);
}
else if(year%100==0)
{
printf("\n\n%d is not leap year.",year);
}
else if(year%4==0)
{
printf("\n %d is a leap year.",year);
}
else
{
printf("\n %d is not a leap year,",year);
}
getch();
}