algorithm/dimigo.goorm.io
조건문 - 조건문의 활용 예제1(홀짝구분)
m0nd2y
2018. 7. 5. 20:26
Practice Contents
0보다 큰 정수 1개를 입력받아 짝수인지 홀수인지 출력하는 프로그램을 작성하시오.
⋇ Please keep the input/output format
#include <stdio.h>
int main() {
int num;
scanf("%d", &num);
if (num % 2 == 0) {
printf("짝수");
}
else printf("홀수");
return 0;
}