Solved programming problem

Find Leap Year in C.

Source code

#include<stdio.h>

int main()

{

    int n;

    printf("Please Enter Year: ");

    scanf("%d",&n);

    if((n%4==0 && n%100==0) || (n%400==0))

    {

        printf("
This is A leap Year.
");

    }

    else

    {

      printf("
This is Not A leap Year.
");

    }

    return 0;

}

Output

Please Enter Year:2000

This is A leap Year.

 

Join the discussion

Add your comment