C Program to check whether Year is Leap or not
// C Program to check whether Year is Leap or not
#include<stdio.h> //header file declaration
#include<conio.h>
void main() // main method
{
int year; // variable declaration
printf("PROGRAM TO CHECK WHETHER YEAR IS LEAP OR NOT \n");
printf("Input year--- ");
scanf("%d", &year); // Input year
if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0)) //check condition
{
printf("It is a leap year", &year);
} else
{
printf("It is not a leap year", &year);
}
getch();
}
OUTPUT:
Comments
Post a Comment