반응형
6번 Solution>
[코드]
#include <stdio.h> // stdio.h 파일을 포함
int main(void) // main 함수 선언
{
int x, y; // 정수형 변수 x, y 선언
scanf("%d %d", &x, &y); // x, y를 키보드로 입력 받음
printf("덧셈: %d\n", x + y); // 덧셈 x+y 값 출력
printf("뺄셈: %d\n", x - y); // 뺄셈 x-y 값 출력
printf("곱셈: %d\n", x * y); // 곱셈 x*y 값 출력
printf("나눗셈: %d\n", x / y); // 나눗셈 x/y 값 출력
}
8번 Solution>
[코드]
#include <stdio.h>
int main(void)
{
int x;
int y;
int prod;
scanf("%d", &x);
scanf("%d", &y);
prod = xy;
printf("곱셈의 결과 = %f", prod);
return 0;
}
9번 Solution>
[결과]
(a) It's never too late./n It never rains but it pours // /n은 줄바꿈 문자가 아닙니다.
(b) 10
(c) 30
(d) 10 + 20 = 30
(e) 10 * 20 = 200
(f) *
**
***
****
반응형
'프로그래밍 > C언어' 카테고리의 다른 글
[쉽게 풀어쓴 C언어 Express] 개정 3판 4장 Exercise 풀이 (0) | 2022.07.24 |
---|---|
쉽게 풀어쓴 C언어 Express 개정3판 3장 programming (0) | 2022.07.22 |
쉽게 풀어쓴 C언어 Express(개정3판) 2장 Programming (0) | 2022.06.05 |
쉽게 풀어쓴 C언어 Express(개정3판) 2장 Exercise (0) | 2022.06.02 |
쉽게 풀어쓴 C언어 Express(개정3판) 1장 Exercise (0) | 2022.05.27 |
댓글