To to check leap year or not


Levels of difficulty: / perform operation:

C program to check whether a given year is leap year or not.

C Program

#include <stdio.h>
#include <conio.h>
void main()
{
	int year,n;
	clrscr();
	printf("\nENTER A YEAR: ");
	scanf("%d",&year);
	if(year%4==0 && year%100 !=0 || year%400==0)
		printf("\n%d IS A LEAP YEAR",year);
	else
		printf("\n%d IS NOT A LEAP YEAR",year);
	getch();
}


Output







Quantitative Aptitude
Reasoning
Programming
Interview