-
Notifications
You must be signed in to change notification settings - Fork 0
/
oprt.java
36 lines (34 loc) · 963 Bytes
/
oprt.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
import java.util.*;
class oprt
{
public static void main(String [] arg)
{
Scanner write=new Scanner(System.in);
System.out.println("Write first number : ");
int num1=write.nextInt();
System.out.println("Write Second number : ");
int num2=write.nextInt();
System.out.println("Write Operation to perform: ");
String op=write.next();
switch(op)
{
case "+":
System.out.println("The Addition of the Numbers is :"+(num1+num2));
break;
case "-":
System.out.println("The Subtraction of the Numbers is :"+(num1-num2));
break;
case "*":
System.out.println("The Multiplication of the Numbers is :"+(num1*num2));
break;
case "/":
System.out.println("The Division of the Numbers is :"+(num1/num2));
break;
case "%":
System.out.println("The reminder of the Numbers is :"+(num1%num2));
break;
default:
System.out.print("There is some error in your program");
}
}
}