c program to find whether a given year is leap year or not

by Nideesh C on April 12, 2011 · 0 comments

in C Programming




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

Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – Program to find the total days in the year till date.
  2. Write a C program to find the simple interest , given principle,rate of interest and times
  3. C program to read N integers (zero, +ve and -ve) into an array A and to a) Find the sum of negative numbers b) Find the sum of positive numbers and c) Find the average of all input numbers Output the various results computed with proper headings
  4. C program to find the biggest of three numbers
  5. C program to find the number of integers divisible by 5 between the given range N1 and N2, where N1 < N2 and are integers. Also find the sum of all these integer numbers that divisible by 5 and output the computed results

Leave a Comment

Previous post:

Next post: