C Program to find prime numbers in a given range
C Program to check Leap Year:
This program checks whether the input year is leap year or not.
You can check whether a year is leap or not by using this mathematical logic:
Leap Year:
If a year is divisible by 4, 100 and 400 then it is a leap year.
If a year is divisible by 4 but not divisible by 100 then it is a leap year
Not a Leap Year:
If a year is not divisible by 4 then it is not a leap year
If a year is divisible by 4 and 100 but not divisible by 400 then it is not a leap year
Source Code:
Show More#include
int main()
{
int y;
printf("Enter year: ");
scanf("%d",&y);
if(y % 4 == 0)
{
//Nested if....
All Chapters — C programming
Similar Questions
From C programs on various integers · C programming
C Program to Find ASCII value of a Character:
C Program to find factorial of number using Recursion
C Program to Check whether an Alphabet is Vowel or Consonant
C Program to Check whether a given Number is Perfect Number:
C Program to Print Armstrong Number from 1 to 1000
C Program to Find Multiplication of two Binary Numbers:
C Program to Reverse a Number & Check if it is a Palindrome: