Java program to build a calculator which gives the user to select one of the options viz.,Addition, Subtraction, Multiplication, Division.
Based on the choice of the user, and already provided 2 Integer values, our program should throw a result of the respective function like adding or subtracting, etc.
Input:
5 6 <-- Numbers for which we perform arithmetic operation.
1 <-- Choice: 1.Addition 2.Subtraction 3.Multiplication 4.Division
Output:
11
Implementation:
Based on the choice of the user, and already provided 2 Integer values, our program should throw a result of the respective function like adding or subtracting, etc.
Input:
5 6 <-- Numbers for which we perform arithmetic operation.
1 <-- Choice: 1.Addition 2.Subtraction 3.Multiplication 4.Division
Output:
11
Implementation: