Ticker

6/recent/ticker-posts

How to calculate Leap Year in C Program

Leap year C Program

Leap Year Program in C Program



#include<stdio.h>

int main()
{
	int year;
	printf("Enter the Year :	");
	scanf("%d",&year);
	
	if(year%100 ==0)
	{
		if(year%400 ==0)
		{
			printf("This is Leap Year");
		}
		else
			printf("This is not a Leap Year");
	}
	else if(year%4 == 0)
	{
		printf("This is Leap Year");
	}
	else
		printf("This is not Leap Year");
	return 0;
}

Inventor Pradhap

Post a Comment

0 Comments