Write a C program to determine whether a given year is a leap year.

This post content:-
  • Algorithm
  • Flowchart
  • C code
  • Output
  • Pdf notes
Algorithm:-
Step 1:- start.
Step 2:- declare variable year.
Step 3:- read variable year.
Step 4:- determine whether a year is a leap year
To determine whether a year is a leap year, follow these steps:

If the year is evenly divisible by 4, go to step 2. Otherwise, go to step 5.
If the year is evenly divisible by 100, go to step 3. Otherwise, go to step 4.
If the year is evenly divisible by 400, go to step 4. Otherwise, go to step 5.
The year is a leap year.
The year is not a leap year.
Step 5:- print the result.
Step 6:- end.

Flowchart:-
C code:-
Output:-
Try it yourself:-

Comments

Popular posts from this blog

Develop and execute C Program to Add Two Distances given in kilometer-meter Using Structures.

Develop a c program to find the sum of all elements stored in a given array using a pointer.