Leap Year

#include<stdio.h>
void main(){
	int year,div;
	printf("Enter the year:\n");
	scanf("%d",&year);
	if(year%100==0){
		div=400;
	}else{
		div=4;
	}
	if(year%div==0){
		printf("Year is leap.\n");
	}else{
		printf("Year is not leap.\n");
	}
}
Advertisements

Author: Hifzur

I am a linux, programming and robotics enthusiast. I also love to write blog about life.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s