-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFun22.java
More file actions
36 lines (32 loc) · 847 Bytes
/
Fun22.java
File metadata and controls
36 lines (32 loc) · 847 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
package fun;
public class Fun22 {
public static void main(String[] args) {
Calc(1,5,2);//a-b=3
Calc(2,5,2);//a*b=10
Calc(3,5,2);//a/b=2
Calc(4,5,2);//a+b=7
}
public static void Calc(int Op,int a,int b){
switch (Op){
case 1->{
int N1 =a-b;
System.out.println("Natija: "+N1);
}
case 2->{
int N2=a*b;
System.out.println("Natija: "+N2);
}
case 3->{
int N3=a/b;
System.out.println("Natija: "+N3);
}
case 4->{
int N4=a+b;
System.out.println("Natija: "+N4);
}
default -> {
System.out.println("Bunday Amal yo`q");
}
}
}
}