All pastes #2105563 Raw Edit

Unnamed

public text v1 · immutable
#2105563 ·published 2012-01-24 03:45 UTC
rendered paste body

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define MIN_GREGYR 1582

int main (void)
{
	int year;

	printf("Enter year:\n");
	scanf("%lf", &year);

	if (year <= MIN_GREGYR)
	{
		printf("Error: Gregorian Calendar not adopted at this time.\n");
	}

	else 
	{
		if ((year%4 != 0) || (year%100 == 0 && year%400 != 0))
			printf("%d is not a leap year.", year);
		
		else
			printf("%d is a leap year!", year);
	}
	
	system ("PAUSE");
	return 0;
}