View Code of Problem 28

#include<string.h>
#include<math.h>
#include<stdio.h>
#include<ctype.h>
int year(int n)
{
	return (n%400==0)||((n%100!=0)&&(n%4==0)); 
}
int main()
{
	int y;
	while(scanf("%d",&y)!=EOF)
	{
		if(year(y)==0)
		printf("Not Leap Year\n");
		else 
		printf("Leap Year\n");
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 28