Write a C program to determine whether an input year is leap year or not.

First open CodeBlocks and create a file.Then save the file named test.cpp.Then write the following simple C code.Finally Run the Code.

Code:


#include<stdio.h>

int main()
{
int year;
printf("Please type value of the year:\n");
scanf("%d",&year);

if((year%4==0&&year%100!=0)||(year%400==0))
printf("It's a leap year.");
else
printf("It's not a leap year.");
return 0;
}

Output: