Program to accept a year and check whether the given year IS leap year or not - 100 Most Important C# Programs

100 Most Important C# Programs

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

Code:

# 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();

}





All materials on the site are licensed Creative Commons Attribution-Sharealike 3.0 Unported CC BY-SA 3.0 & GNU Free Documentation License (GFDL)

If you are the copyright holder of any material contained on our site and intend to remove it, please contact our site administrator for approval.

© 2016-2025 All site design rights belong to S.Y.A.