Program to cheque enter year is leap year or not leap year using switch case in C-language

#include<stdio.h>
int main()
{
    int x;
    printf("Enter the year\n");
    scanf("%d",&x);
    switch(x%4==0&&x%100!=0||x%400==0)
    {
        case 1:
        printf("Enter year is leap year");
        break;
        default:
        printf("Enter year is not leap year");
        break;
     
    }
}

OUTPUT
Enter the year
2020
Enter year is leap year

Comments

Popular posts

Creative pattern of butterfly in C-language

Program to show present time and date in C-language

Introduction of C-language.

Program to cheque enter number is a perfect number or not using if else in C-language

Program to cheque four digits number is palindrome or not in C-language

Program to print the cube of a number in c-language

Simple Hello world program in c- language