C Program to check leap year
C Program to check leap year is a common program in c language which is mostly asked in practicals and exams, c programming is just perfect to make this program, in this particular program to check if a year is leap year or not we are given a year by the user and we have to check it that, it is a leap year or not. A leap year comes once after 4 years, means in four years there is just one leap year. We will make a program in which user will enter a year and we will find if it is a leap year or not.
C Program to check leap year is a common program in c language which is mostly asked in practicals and exams, c programming is just perfect to make this program, in this particular program to check if a year is leap year or not we are given a year by the user and we have to check it that, it is a leap year or not. A leap year comes once after 4 years, means in four years there is just one leap year. We will make a program in which user will enter a year and we will find if it is a leap year or not.
Description of C Program to check leap year
In this program we will take a integer type variable, 'year' and then ask the user, to insert a year, and will store that in variable 'year', then using if statement we will check if 'year % 400 = = 0' then we will print the year is leap year then, use else if statement to check 'year%100= =0', if condition found true then print 'year is not leap year' for it again use if else statement to check if 'year%4= =0' then print 'this is a leap year', then use else statement and print 'year is not prime'.
C Program to check leap year
Output
This is all how you can create a C program to check leap year simply, if face any problem in this program you are free to comment and ask your problems.


ConversionConversion EmoticonEmoticon