필기4지선다보통 · 20점

5394.

다음 C 프로그램을 실행했을 때 출력 결과는?

1#include <stdio.h>
2
3struct rec {
4 int total;
5 int v[8];
6};
7
8int main(void) {
9 int i;
10 struct rec p, q;
11 p.total = 0;
12 q.total = 0;
13 for (i = 0; i < 8; i++) {
14 p.v[i] = i;
15 q.v[i] = p.v[i] + i;
16 }
17 for (i = 1; i < 8; i = i + 2) {
18 p.total = p.total + p.v[i];
19 q.total = q.total + q.v[i];
20 }
21 printf("%d", p.total + q.total);
22 return 0;
23}
필기 3과목 · 프로그래밍 언어 활용★★★ 4회 출제 · 최근 2026년 2회
정답을 골라 누르면 바로 채점돼요

해설을 먼저 보거나 틀린 뒤 맞히면 필기 점수가 20%만 반영돼요.