Program to Find that Given Input is a Leap Year Or Not.
#include<stdio.h>
void main ()
{
int y;
printf ("Enter Any Year ");
scanf("%d",&y);
if (y%4==0)
if (y%100==0)
if (y%400==0)
printf("Leap Year");
else
printf("Not Leap year");
else
printf("Leap Year");
else
printf("Not Leap Year");
getch();
}
void main ()
{
int y;
printf ("Enter Any Year ");
scanf("%d",&y);
if (y%4==0)
if (y%100==0)
if (y%400==0)
printf("Leap Year");
else
printf("Not Leap year");
else
printf("Leap Year");
else
printf("Not Leap Year");
getch();
}
Output:-
0 comments:
Post a Comment