#include<stdio.h>
int main(){
int Y;
scanf("%d",&Y);
if(Y%400==0||(Y%4==0&&Y%100!=0)){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
}
what’s the problem with it?
#include<stdio.h>
int main(){
int Y;
scanf("%d",&Y);
if(Y%400==0||(Y%4==0&&Y%100!=0)){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
}
what’s the problem with it?
I actually cannot remember why I said that. Yes, you are right. You need to check bot if the year is equally divided by 4 and not equally divided by 400 to get your solution accepted. My mistake.
#include <stdio.h>
int main()
{
int year;
printf("Enter The year:");
scanf(“%d”,&year);
if(year%2 == 0){
printf("%d yes\n",year);
}
else
printf("%d no\n(",year);
return 0;
}
What is the problem of this code??
what is the problem?
y = int(input())
if 0 < y < 9999 and y%4 = 0 and y%400 != 0 :
print('YES')
else:
print('NO')