#include<stdio.h>

#include<conio.h>

void main()

{

int year;

clrscr(); //to clear the screen

printf(“Enter any year(4-digit):”);

scanf(“%d”,&year);

if(year%100==0)

{

if(year%400==0)

printf(“Leap Year”);

}

else

if(year%4==0)

printf(“nLeep Year”);

else

printf(“nNot leap year”);

getch(); //to stop the screen

}

almost this code are right but not fully perfect

What is missing, let me know about it.

the logic used is incomplete

plz mention it in the comment.

the logic is

1) the year should be divisible by 400 and 100 ,that is; only 400 because the no divisible by 400 will also be divisible by 100

or

2) the no should be divisible by 4 and not divisible by 100.

so it should be

if(year%400==0||year%4==0&&year%100!=0);

thanks for your nice suggestion. 🙂