Problem
Any year is entered through the keyboard. Write a function to determine whether the year is a leap year or not.Solution - Code
#include<stdio.h>#include<conio.h>
#include<stdlib.h>
void lp_yr();
main()
{
lp_yr();
system("pause");
}
void lp_yr()
{
int x,y;
printf("Enter any year : ");
scanf("%d",&x);
if (x%4==0)
printf("entered year is leap\n");
else
printf("enterd year is not leap\n");
}
No comments :
Post a Comment
Note: Only a member of this blog may post a comment.