Notice
Recent Posts
Recent Comments
Creative Code
isOrdinary.c (평년,윤년 구분하기) 본문
#include <stdio.h>
// 평년인지 아닌지 판별
int main(void)
{
int year;
printf("year :");
scanf("%d",&year);
//int isOrdinary = (year % 4 != 0 || year % 100 == 0 && year %400 !=0);
int isOrdinary = !(year % 4 == 0 && year % 100 != 0 || year % 400 ==0);
printf("%d년 isOrdinary - %d\n",year,isOrdinary);
return 0;
}
'C Programming' 카테고리의 다른 글
maxMidMin.c (최대,중간,최소값 구하기) (1) | 2023.07.31 |
---|---|
letterAttribute.c (비트연산) (1) | 2023.07.31 |
isLeap.c(윤년,평년 구분) (0) | 2023.07.31 |
isAlphabet.c (0) | 2023.07.31 |
compareOp.c (0) | 2023.07.31 |