• Language

    C

  • Description

    Determines if a year is leap or not

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
    int year;
    printf ("Enter the value of year: ");
    scanf ("%d", &year);
    (void) getchar ();
    if(((year%4==0)&&(year%100!=0))||year%400==0)
        printf ("the year is leap\n");
    else
        printf ("the year is not leap\n");
    putchar ('\n');
    system ("pause");
    return EXIT_SUCCESS;
}