Program to display no. of days in the year while taking care of leap year

//Program to display no. of days in the year while taking care of leap year
#include<stdio.h>
#include<conio.h>
int main()
{
int a;
clrscr();
printf("Enter a Year\n");
scanf("%d",&a);
if(a%4==0&&a%100!=0||a%400==0)

printf("Year has 366 Days");

else printf("Year has 365 Days");


getch();
return 0;

}


To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

No comments:

Post a Comment