중첩 if문
if와 else if와 else if 등등
#include <stdio.h>
int main(void) {
int test_if_result4 = testIf_4();
return 0;
}
int testIf_4() {
printf("----------- testIf_4 종료 -----------\n\n");
int a;
printf("정수를 입력해주세요 : ");
scanf("%d", &a);
if (a >= 90) {
printf("A학점");
}else if(a >= 80) {
printf("B학점");
}
else if (a >= 70) {
printf("C학점");
}
else {
printf("F학점");
}
return 0;
printf("----------- testIf_4 종료 -----------\n\n");
}
'언어 > C언어' 카테고리의 다른 글
[C언어] 3일차 -6 if / scanf 응용 / 계산기 만들기 (0) | 2025.02.10 |
---|---|
[C언어] 3일차 -5 switch (0) | 2025.02.09 |
[C언어] 3일차 -3 if / scanf() / 입력한 값이 홀수 인지 짝수인지 구하기 (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 |