Completely Solved C, C++ Programs Assignment.




C Program to accept a year and check whether the given year IS leap year or not.

Filed Under:

Problem 6: C Program to accept a year and check whether the given year is leap year or not.
#include<stdio.h>
#include<conio.h>
main( )
{
int y;
clrscr( );
printf(“enter a year:”);
scanf(“%d”,&y);
if(y%4==0& &y%100!=0|| y%400==0);
printf(“the above given year IS a leap
year”);
else
printf(“the above given year IS not a leap year”);
getch();
}
C compiler: gcc 4.1.2

Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments