View Code of Problem 28

#include <stdio.h>
#include <math.h>
#define N 100
#define year(y) !(y % 4)&&(y % 100)||!(y % 400)
int main()
{
	int y[N];
	int t, i;
	i = 0;
	do{
	    scanf("%d\n", &y[i++]);
	}while(!'\n');
	for(t = 0; t <= i; t++)
	{
	    if(year(y[t]))
		{
		    printf("Leap Year\n");
		}
	    else
		{
		    printf("Not Leap Year\n");
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 28