Using this mathematical argument In the leap year program in C you can check if there is a leap year:
Year:
Divide a year by 4, 100, and 400, and it’s a leap year
If a year is divided by 4 but not divisible by 100, it is a leap year.
Not a Leap Year:
If a year is not divided by 4 classes, it is not a leap year
A year is divisible by 4 and 100, but if not divided by 400, it is not a leap year
Writing this argument in C program You must have the knowledge to follow C programming to understand this program:
How to check LAP annual plan in C 2020
For centuries (years ending with 00), a leap year is divisible by exactly 4. The century is a leap year if it is fully divided by 400
For example,
1999 was not a leap year
2000 is a leap year
2004 was a leap year
Algorithm
Instruction for this project –
Get started
Step 1 Take the integer variable year
Step 2 Check value to the variable
Check if step 3 year is divided by 4, but show “year of life”, not 100.
Check that the 4 years of the post is divided by 400 div, show “LIVE YEAR”.
Step 5 → If not, turn off “Not loop year”
Flow chart In That Way We Can Check leap year program in C
We will draw the flow map for this project as given below –
If C programming..and, if built-in..and
Add #stdio.h>
int main ()
{
int y;printf (“Enter year:”);
scanf (“$ d”, & y);If (y$ 4 == 0)
{
// Otherwise nest
If (y$ 100 == 0)
{
If (y$ 400 == 0)
printf (“$ d is a lifetime”, y);
Others
printf (“$ d is not lip year”, y);
}
Others
printf (“$ d is loop year”, y);
}
Others
printf (“$ d is not lip year”, y);Return 0;
}*Here $=%*
Release:
Enter the year: 1991
1991 was not hop year