Write program to input year and check year is leap or not.

In this program we input an year and check year is leap or not, that means we input a year by user and then he find Leap year if condition is true else Not leap year.
   As we know leap year means that year which divided by 4. In program we write a condition that if year fully divided by 4 then Leap year else Not leap year.
   Let's Begin --


#include<stdio.h>
#include<conio.h>
void main()
{
int y;
clrscr();
printf("Enter a year=");
scanf("%d",&y);
if(y%4==0)
 printf("\nLeap year");
else
 printf("\nNot leap year");
getch();
}

OUTPUT 
Enter a year=2001

Not leap year
                    OR
Enter a year=2016

Leap year

Related Examples 
  1. Write a program to input a number and check number is odd or even.
  2. Write a program to input two number and find smallest number
  3. Write a program to input two number and find highest number. 
 4. Write a program to input a number and check number is positive,negative or nuteral. 

Share and Comment. Follow for recently updates.

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to input speed of Royal Enfield and check it's running at economic speed or not.