2022. 02. 10 if문 (if_3)

2022. 2. 14. 00:37과제 업로드

#include <stdio.h>

int main()
{
int input;

printf("태어난 년도를 입력하세요:");
scanf_s("%d", &input);
if (input == 0)
{
printf("프로그램 종료\n");
}
else if (( (input % 4 == 0) && !(input % 100 == 0) ) || (input % 400 == 0))
{
printf("%d년은 윤년입니다.\n", input);
}
else
{
printf("%d년은 평년입니다.\n", input);
}
return 0;
}

 

'과제 업로드' 카테고리의 다른 글

2022.02.14 문자형 배열을 이용한 문제  (0) 2022.02.14
2022.02.10 if문 (if_4)  (0) 2022.02.14
2022. 02. 11 if문 (if_2)  (0) 2022.02.14
2022.02.11 if문제 (if_1)  (0) 2022.02.11
2022.02.09 문자 비교 문제(opExam_3)  (0) 2022.02.11