C Code 3 _ To find whether the given year is a Leap year or Not


Program:


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



Output:







Thank You ...
Previous Post
Next Post
Related Posts

0 comments:

Popular Posts