Skip to content

Commit 13ef0f6

Browse files
committed
240610 정보처리기사 실기 - C언어 (2022-2회 15번)
1 parent 5e1b8d5 commit 13ef0f6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

EIP/C/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,33 @@
325325
326326
- [답] 2
327327
328+
- 문제15. 다음 C언어로 구현된 프로그램을 분석하여 그 실행 결과를 쓰시오. (단, 출력문의 출력 서식을 준수하시오)
329+
330+
```c
331+
#include <stdio.h>
332+
333+
int len(char* p);
334+
335+
int main() {
336+
char* p1 = "2022";
337+
char* p2 = "202207";
338+
int a = len(p1);
339+
int b = len(p2);
340+
printf("%d", a + b);
341+
}
342+
343+
int len(char* p) {
344+
int r = 0;
345+
while(*p != '\0'){
346+
p++;
347+
r++;
348+
}
349+
return r;
350+
}
351+
```
352+
353+
- [] 10
354+
328355

329356

330357
#### 2022년 3회

0 commit comments

Comments
 (0)