Pages

Subscribe:

Check Leap year In C Program

A leap year , which year is a containing one extra day .The earth takes 365 and 6 hours to revolves around the sun . February 29 date  usually occurs every 4 four years that day count extra 6 hours( 6*4=24 hours mean extra one day ).A year will be leap year if it is a divisible by 4 and 400.

Example :
  1. 1988
  2. 2012
  3. 2016
  4. 2020  
To Check Whether Given Year Is Leap Year or Not :

Program :

#include<stdio.h>
#include<conio.h>
void main()
{
int a=0;
char ch;
do{
    clrscr();
    printf("\n\t Enter year:");
    scanf("%d",&a);
    if(a%4==0||a%400==0)
        printf("\n\t <%d> Year is LeapYear",a);
    else
        printf("\n\t <%d> Year is not LeapYear",a);

    printf("\n\t continue (y/n):");
    ch=getch();
 }while(ch=='Y'||ch=='y');
}


output :


No Preview



If you have any Further Information and Quires about this Article don't hesitate to comment in comment box below.
                                                           AND

 If you like this article , like our Facebook like page and click  +1 to support 123techguide
comments powered by Disqus
 

Listed In

Bloggers - Meet Millions of Bloggers http://Link-exchange.comxa.com
Blog Search: The Source for Blogs Internet Blogs

Disclaimer

The contents in this blog are taken from various sources available over the internet, therefore we do not gurantee of it's accuracy, if you find any of the content in the blog is infringing it's copyright, please do email us on '123techguide@gmail.com' and we will make sure to remove the same from the blog at the earliest.