-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
57 lines (47 loc) · 905 Bytes
/
main.c
File metadata and controls
57 lines (47 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <stdio.h>
#include "multiply.h"
// review #2
static int s_multi_x = 15;
static int g_multi_y = 4;
int sub(int a, int b)
{
return a - b;
}
int add_numbers(int x, int y)
{
int tmp;
tmp = x + y;
return tmp;
}
int main(void)
{
int a, b, c, d;
printf("Hello World!\n");
printf("두 수를 입력하세요.\n");
scanf("%d %d", &a, &b);
c = add_numbers(a, b);
if (c >= 10)
{
printf("10 이상\n");
}
else
{
printf("10 미만\n");
}
d = sub(a, b);
if (d > 0)
{
printf("두 수의 차이는 양수입니다.\n");
}
else if (d == 0)
{
printf("두 수의 차이는 0입니다.\n");
}
else
{
printf("두 수의 차이는 음수입니다.\n");
}
int multi_result = multiply(s_multi_x, g_multi_y);
printf("Multi : %d\n", multi_result);
return 0;
}