# Basic Calculator

```fun main() {
println("Enter Two Integer Number")//1
println("Enter your choice\n A for Addition\n M for Multiply \n D for Division \n S for Substation")//4
val result = when(userChoice)//6
{
"S","s"-> "SubStraction of Two Number \$first-\$second=\${first-second}"//8
"M","m"->  "Multiplication of Two Number \$first*\$second =\${first*second}"//9
"D","d"->  "Division of Two Number= \$first/\$second=\${first/second}"//10
else->"Sorry Wrong Choice"//11
}
println("Calculation Result=\$result")//12
}
```
1. Instruct the user to Enter two number for calculation
2. The first Number entered by user convert into int and assigned to the First variable
3. The Second Number entered by user convert into int and assigned to the second variable
4. Instruct the user to Enter their choice to perform the calculation
5. The choice entered by the user assigned to the choice variable
6. When statement result based on user choice assigned to result variable
7. Operation addition is performed if the user enters “A” or “a”
8. Operation subtraction is performed if the user enters “S” or “s”
9. Operation multiplication is performed if the user enters “M” or “m”
10. Operation Division is performed if the user enters “D” or “d”
11. if Enter wrong input mentioned in 7,8,9,10 then else part execute
12. Finally, Result is print on command prompt

Output of Program

Enter Two Integer Number

20

30

M for Multiply

D for Division

S for Substation

a

Multiplication

Enter Two Integer Number

30

50

M for Multiply

D for Division

S for Substation

m

Calculation Result=Multiplication of Two Number 30*50 =1500

Substation:-

Enter Two Integer Number

45

50

M for Multiply

D for Division

S for Substation

s

Calculation Result=SubStraction of Two Number 45-50=-5

Division:-

Enter Two Integer Number

200

40