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

This blog has been migrated to learn c programming for beginners


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

  1. C program to check if the supplied year is leap year or not.. It clearly communicated the idea of why functions are beneficial in programming. If anyone want to learn C you can visit our website. This make a mastered in C programing. We have complete C tutorials teaching you to program in C. Whether you’ve had any prior experience programming or not, the tutorials on this site will walk you through all the steps you’ll need to know in order to create and compile your programs.

    Thank you very much!

    ReplyDelete

Post a Comment

Popular posts from this blog

C- Computer programming language-field of study

C program to find Transpose of Matrix.