Q:

Write a program in c to find the leap year

0

Write a program in c to find the leap year

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Algorithm:-

·        start

·        year

·        if(year%4==0) then  leap year

·        else not leap year

·        stop

     Flowchart:

Program:

#include<stdio.h>
#include<conio.h>
int main()
{
int year;
clrscr();
printf("enter the year :");
scanf("%d",&year);

if(year%4==0)
{
printf("the year %d is leap year",year);
}
else
{
printf("the year %d is not leap year",year);
}

return 0;

}

Output:

Enter a year: 2022
2022 is not a leap year.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Programming Exercises With Solutions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a progran to calculate factorial of a numbe... >>
<< Write a program in c to find prime number or not...