-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalc.java
More file actions
38 lines (27 loc) · 674 Bytes
/
Copy pathCalc.java
File metadata and controls
38 lines (27 loc) · 674 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
package java3;
public class Calc {
static int add(int n1, int n2) {
int sum = n1+n2;
return sum;
}
static int minus(int n1,int n2) {
return n1 - n2;
}
//multi(°öÇϱâ), divide(³ª´©±â)
static int multi(int n1, int n2) {
return n1 * n2;
}
static int divide(int n1, int n2) {
return n1 / n2;
}
public static void main(String[] args) {
int resultAdd = add( 40, 20);
System.out.println(resultAdd);
int resultMinus = minus(40, 20);
System.out.println(resultMinus);
int resultMulti = multi(40, 20);
System.out.println(resultMulti);
int resultDivide = divide(40, 20);
System.out.println(resultDivide);
}
}