Hi,
I don't understand the if statement here. Can anyone explain how the execution of if loop will proceed.
Why are we using || and && operators here.
#include<stdio.h>
void main
{
int year;
printf("Enter the year: ");
scanf("%d",&year);
if(year%400 ==0 || (year%100 != 0 && year%4 == 0))
{
printf("Year %d is a leap year",year);
}
else
{
printf("Year %d is not a leap year",year);
}
Thanks