-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab6SimpleMaths.java
More file actions
46 lines (37 loc) · 1.01 KB
/
Lab6SimpleMaths.java
File metadata and controls
46 lines (37 loc) · 1.01 KB
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
import java.util.*;
class Lab6SimpleMaths {
static int add(int a, int b) {
return a + b;
}
static double add(double a, double b) {
return a + b;
}
static int sub(int a, int b) {
return a - b;
}
static double sub(double a, double b) {
return a - b;
}
static int mul(int a, int b) {
return a * b;
}
static double mul(double a, double b) {
return a * b;
}
static int div(int a, int b) {
return a / b;
}
static double div(double a, double b) {
return a / b;
}
public static void main(String[] args) {
System.out.println(add(11, 11));
System.out.println(add(12.5, 12.6));
System.out.println(sub(22, 12));
System.out.println(sub(24.3, 20.6));
System.out.println(mul(12, 12));
System.out.println(mul(14.4, 26.4));
System.out.println(div(12, 12));
System.out.println(div(12.48, 12.2));
}
}