-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhesapmakinesi.java
More file actions
42 lines (36 loc) · 1.06 KB
/
hesapmakinesi.java
File metadata and controls
42 lines (36 loc) · 1.06 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
import java.util.Scanner;
public class hesapmakinesi {
public static void main(String[] args) {
int a,b,key;
Scanner sc = new Scanner(System.in);
System.out.println("ilk sayi:");
a = sc.nextInt();
System.out.println("ikinci sayi:");
b = sc.nextInt();
System.out.println("islemi secin---\n1-toplama\n2-cikarma\n3-carpma\n4-bolme\n-----------");
key = sc.nextInt();
double total;
switch (key) {
case 1:
total = a+b;
System.out.println(total);
break;
case 2:
total = a-b;
System.out.println(total);
break;
case 3:
total = a*b;
System.out.println(total);
break;
case 4:
total = a/b;
System.out.println(total);
break;
default:
System.out.println("gecersiz islem !!");
break;
}
sc.close();
}
}