1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include<stdio.h>
main()
{
int year;
printf("Enter the Year you want to check:- ");
scanf("%d",&year);
if(year % 100 ==0)
{
if (year % 400 == 0)
printf("Century Leap Year");
else
printf("Not a leap year");
}
else
{
if(year % 4 == 0)
printf("Leap Year");
else
printf("Not a leap year");
}
}
|
And I think you understand this code.
0 comments:
Post a Comment