Click here to Upload your own logic for this program.

Write a program to print the given year is a leap year or not?


Program:


#include<stdio.h> main() { int year; printf("Enter a year:"); scanf("%d",&year); if(year%4==0 && year%100!=0 ||year%400==0) printf("Given year is a leap year"); else printf("Given year is not a leap year"); }
Output:
		

Enter a year:2004 Given year is a leap year