C/c언어 수업
숫자 세개 입력받은 뒤 홀수 짝수
by sj0020
2020. 7. 31.
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void main(void) {
int num1 = 0;
int num2 = 0;
int num3 = 0;
printf("enter the num1:");
scanf("%d", &num1);
printf("enter the num2:");
scanf("%d", &num2);
printf("enter the num3:");
scanf("%d", &num3);
if (num1 % 2 == 0) {
printf("num1 is even number.\n");
}
else {
printf("num1 is odd number.\n");
}
if (num2 % 2 == 0) {
printf("num2 is even number.\n");
}
else {
printf("num2 is odd number.\n");
}
if (num3 % 2 == 0) {
printf("num3 is even number.\n");
}
else {
printf("num3 is odd number.\n");
}
}