C program to check if the supplied year is leap year or not.

Write a C program to check if the supplied year is leap year or not. 

This C program check if the supplied year is leap year or not.

C Program source code

#include<stdio.h>
#include<conio.h>
int main()
{
 int y;
 printf("Enter a year:\n");
 scanf("%d",&y);
 if(y%400==0)
 {
  printf("Its a leap year.");
 }
 else if(y%100==0)
 {
  printf("Its not a leap year,");
 }
 else if(y%4==0)
 {
  printf("Its a leap year,");
 }
 else
 {
  printf("Its not a leap year,");
 }
 getch();
 return(0);
}
You can Browse related article below for more information and program code related to different math operation.  Does above is helpful , Post you views in comment

DO NOT MISS OTHER C PROGRAMMING TUTORIAL

* indicates required



C program to check if the supplied year is leap year or not.

Comments

Popular posts from this blog

Print pattern in c - explore new perspectives in pattern printing

Copy Constructor

C Programming Quiz online on input and output