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

You are here: » C PROGRAM TO FIND WHETHER A GIVEN YEAR IS LEAP YEAR OR NOT

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
——————————————*/



Similar Posts:

 
 
Posted by 4 Responses

Categories:PREPARATION MATERIALS;Tags: , , , , , ,

Free Email Newsletter

Stay Updates with this Blog. Get Free email newsletter updates..

And then confirm your email subcription

   

4 Comments to “C PROGRAM TO FIND WHETHER A GIVEN YEAR IS LEAP YEAR OR NOT”

  1. joydeep says:

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

  2. Nikhil Makde says:

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

  3. B.s.mukesh kumar says:

    thank u..:-)

  4. sowmiya says:

    i want a c program to perform swapping 0f 2 numbers

Leave your comment here:

 
Sponsored links
Free Email Updates
Get All Latest Updates in Ur e-mail Inbox..

And then confirm your email subcription

Sponsored Links