-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweekthreeex3.java
52 lines (31 loc) · 863 Bytes
/
weekthreeex3.java
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
import java.util.Scanner;
public class weekthreeex3{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int a, b;
System.out.print("Enter First No: ");
a = input.nextInt();
System.out.print("Enter Second No: ");
b = input.nextInt();
System.out.println("1. Division ");
System.out.println("2. Subtraction ");
System.out.println("3. Addition ");
System.out.println("4. Multiplication ");
int op;
System.out.print("Enter which operation would like to do...");
op = input.nextInt();
if(op==1){
System.out.print("a / b: ");
System.out.println(a/b);
}else if(op==2){
System.out.print("a - b: ");
System.out.println(a-b);
}else if(op==3){
System.out.print("a + b: ");
System.out.println(a+b);
}else if(op==4){
System.out.print("a * b: ");
System.out.println(a*b);
}
}
}