/ Undifined / 9 - WAP that tells whether a given year is a leap year or not.

9 - WAP that tells whether a given year is a leap year or not.

WAP that tells whether a given year is a leap year or not. 

#include <stdio.h>
 
 void main()
 {
	int year;
 
	printf("Enter a year\n");
	scanf("%d",&year);
 
	if ( (year % 4) == 0)
	   printf("%d is a leap year",year);
	else
	   printf("%d is not a leap year\n",year);
 }
Output 
Enter a year
2000
2000 is a  leap year
 
RUN2
Enter a year
2007
2007 is not a leap year

about author

Blogger Sens it website about blogger templates and blogger widgets you can find us on social media
Previous Post :Go to tne previous Post
Next Post:Go to tne Next Post

No comments:

Post a Comment