One year has the length of 365 days, 5 hours, 48 minutes and 45 seconds. This is hard to calculate with, so a normal year has been given 365 days and a **leap year** 366 days. In **leap years**, February 29th is added as leap day, which doesn't exist in a normal year. A **leap year** is every 4 years, but not every 100 years, then again every 400 years.

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

Enter a year: 2016 2016 is a leap year.

Recent Posts

C# - Generic Collection Namespace
C# - Generic List Class
C# - Path Class & Special Folders
C# - Regular Expressions Classes
C# - Directory & DirectoryInfo Class
C# - File & FileInfo Class
Features of C
Check Number Is Armstrong Number Or Not Using Function
Program To Check Number Is Palindrome Or Not Using Function
Program To Calculate Power Using Function

Popular Posts

C# - .NET Framework
Calculate Area And Perimeter Of Rectangle
Palindrome Number Series from 1 to 500
Program To Check Number Is Palindrome Or Not Using Function
C# Simple Interest Application Example
Calculating The Area and The Perimeter of Rectangle C# Program
Program To Find Power of a Number using for loop
Program To Calculate Power Using Function
C# Program To Print Muliplication Table of Number
C# - Home