Monday, July 17, 2017

C program for Leap year

This program find that where entered year is leap year or not. Leap year means year in which 29 February is present.
Leap year also identify by using some mathematical algorithms, If any year is divisible by 4 and gives remainder 0 than that year is leap year. ex 400, 800, 1200, 1600, 2000, 2004, 2008 etc.

Program:

#include<stdio.h>
int main()
{
    int i;
    char a;
    do
    {
    printf("\nEnter year=");
    scanf("%d",&i);
    if(i%4==0)
    {
    printf("\n%d is leap year",i);
    }
    else{
    printf("\n%d is not leap year",i);
    }
    printf("\nDo u want to Continue(y/n)=");
    scanf("\n%c",&a);
    }while(a=='y'||a=='Y');
    printf("\nThank you...\n");
    return 0;
}

Output:

Please comment and give Suggestion on this post, if you want any other program or help then type in comment or contact me, and give feedback for this blogs.

No comments:

Post a Comment

Acer Nitro 5 Ryzen 7 4800H - Blender Open Data Benchmark | Blender BMW Benchmark

Hello friends in this video I have perform benchmark of Acer Nitro 5 Ryzen 7 4800H laptop using Blender Open data Benchmark tool. In this to...