정보처리기사 필기 · 2022년 3회 · 80번

Q.80202234과목 · 프로그래밍 언어 활용
아래 C언어 프로그램을 실행한 뒤 ‘c’를 입력하면 출력되는 결과는?
#include <stdio.h>
main() {
    char ch;
    scanf("%c", &ch);
    switch (ch) {
    case 'a':
        printf("one ");
    case 'b':
        printf("two ");
    case 'c':
        printf("three ");
        break;
    case 'd':
        printf("four ");
        break;
    }
}
  • 1one two three four
  • 2three
  • 3one
  • 4one two

정답: 2 · three

이 회차 문제 풀어보기 →정보처리기사 필기 더 풀기