#include <stdio.h>
int main()
{
int year;
printf("Input the year.\n");
scanf("%d", &year);
if((year%100!= 0) && ((year%4==0) || (year%400==0 && year%100 != 100)))
{
printf("%d is a leap year.\n", year);
}
else //else if (x), if there is no more condition to attacth after one if.
{
printf("%d is not a leap year.\n", year);
}
return 0;
}
int main()
{
int year;
printf("Input the year.\n");
scanf("%d", &year);
if((year%100!= 0) && ((year%4==0) || (year%400==0 && year%100 != 100)))
{
printf("%d is a leap year.\n", year);
}
else //else if (x), if there is no more condition to attacth after one if.
{
printf("%d is not a leap year.\n", year);
}
return 0;
}
댓글
댓글 쓰기