Friday, June 1, 2012

Leap Year

Assalamu Alaikum. Hope, you all are well by the grace of Almighty. Today we learn how find out the leap year. Let's look at the problem.

Problem: Any year is entered through the keyboard. Write a program to determine whether the year is a leap year or not.

Sample Input: Enter the Year: 2012
Sample Output: Leap Year

Solve:


Leap Year:


A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.


By using this calculation we write a C programming code. Let's look at the programs.
























We can also do this program by following way:




















Thank You all..:)

0 comments:

Post a Comment