다음 C 프로그램의 실행 결과를 쓰시오.
1#include <stdio.h>2 3int main(void) {4 char s[] = "KOREA";5 char *p = s;6 printf("%c", *(p + 2));7 printf("%c", *p + 2);8 p += 3;9 printf("%s", p);10 printf(" %d\n", (int)(p - s));11 return 0;12}
#include <stdio.h>
int main(void) {
char s[] = "KOREA";
char *p = s;
printf("%c", *(p + 2));
printf("%c", *p + 2);
p += 3;
printf("%s", p);
printf(" %d\n", (int)(p - s));
return 0;
}
해설을 먼저 보면 이후 정답 시 점수가 50%만 반영됩니다.