C PROGRAM TO FIND WHETHER A GIVEN YEAR IS LEAP YEAR OR NOT

/* Write a c program to find whether a given year is leap year or not  */
 #include <stdio.h>
 void main()
 {
int year;
printf(“Enter a year\n”);
scanf(“%d”,&year);
if ( (year % 4) == 0)
  printf(“%d is a leap year”,year);
else
  printf(“%d is not a leap year\n”,year);
 }
/*——————————————
Output
Enter a year
2000
2000 is a  leap year
RUN2
Enter a year
2007
2007 is not a leap year
——————————————*/



ilook website

4 Comments

  1. is the year 1900 a leap year???? is the year 1800 a leap year???? is the year 2300 a leap year????

  2. It is a true way to learn c-programming.
    There are many pragrams that are described in a very sequential and easy manner..!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.