If scanf()
#include <stdio.h>
int main(void) {
int test_scanf_1 = testScanf();
return 0;
}
int testScanf() {
printf("----------- testScanf 시작 -----------\n\n");
int a;
printf("정수를 입력해 주세요");
scanf("%d", &a);
if (a % 2 == 0) { //짝수일 경우
printf("짝수를 입력하셨군요");
}
else {
printf("홀수를 입력하셨군요");
}
return 0;
printf("----------- testScanf 종료 -----------\n\n");
}
'언어 > C언어' 카테고리의 다른 글
[C언어] 3일차 -5 switch (0) | 2025.02.09 |
---|---|
[C언어] 3일차 -4 if / 중첩 if문 (0) | 2025.02.09 |
[C언어] 3일차 -2 if / printf() (0) | 2025.02.09 |
[C언어] 3일차 -1 할일 / if / switch / for / while / do ~ while (0) | 2025.02.09 |
[C언어] 2일차 통합본 /0318 (0) | 2025.02.09 |