문제 01) 자신의 이름과 나이, 주소 등을 3줄에 걸쳐서 다음과 같이 출력하는 프로그램을 작성하여 보자.
1
2
3
4
5
6
|
#include<stdio.h>
int main() {
printf("이름: 홍길동\n나이: 21살\n주소: 서울 200번지");
return 0;
}
|
cs |
문제 02) 다음과 같은 형태로 출력하는 프로그램을 작성하여 보자. 단 pritnf()는 한번만 호출하여야 한다.
1
2
3
4
5
6
|
#include<stdio.h>
int main() {
printf("Hello\nC\nProgrammers!");
return 0;
}
|
cs |
문제 03) 리포트 표지를 출력하는 프로그램을 작성하여 보자.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#include<stdio.h>
int main() {
printf("****************************************\n");
printf(" 리포트 \n");
printf("****************************************\n\n");
printf("****************************************\n");
printf(" 학과: 컴퓨터공학과\n");
printf(" 학번: 20180001\n");
printf(" 성명: 홍길동\n");
printf("****************************************\n");
return 0;
}
|
cs |
문제 04) 다음과 같이 출력되는 프로그램을 작성하여 보자.
1
2
3
4
5
6
7
8
9
10
11
|
#include<stdio.h>
int main() {
printf("일\t월\t화\t수\t목\t금\t토\n");
printf("1\t2\t3\t4\t5\t6\t7\n");
printf("8\t9\t10\t11\t12\t13\t14\n");
printf("15\t16\t17\t18\t19\t20\t21\n");
printf("22\t23\t24\t25\t26\t27\t28\n");
printf("19\t30\t31");
return 0;
}
|
cs |
문제 05) 7과 8을 가지고 사칙연산을 한 결과를 다음과 같이 출력하는 프로그램을 작성하라. 본문의 Lab 문제를 참조한다.
1
2
3
4
5
6
7
8
9
|
#include<stdio.h>
int main() {
printf("7+8=%d\n",7+8);
printf("7-8=%d\n",7-8);
printf("7*8=%d\n",7*8);
printf("7/8=%d\n",7/8);
return 0;
}
|
cs |
:)
'C > 쉽게 풀어쓴 C언어 Express' 카테고리의 다른 글
[쉽게 풀어쓴 C언어 Express] 7장 programming (0) | 2022.08.06 |
---|---|
[쉽게 풀어쓴 C언어 Express] 6장 programming (0) | 2022.08.05 |
[쉽게 풀어쓴 C언어 Express] 5장 programming (0) | 2022.08.04 |
[쉽게 풀어쓴 C언어 Express] 4장 programming (0) | 2022.07.29 |
[쉽게 풀어쓴 C언어 Express] 3장 programming (0) | 2022.07.28 |
댓글