Instead of writing many if..else statements, you can use the switch statement.
(অনেক if..else স্টেটমেন্ট লেখার পরিবর্তে, আপনি সুইচ স্টেটমেন্ট ব্যবহার করতে পারেন।)
Syntax:
Output:
WAP to input two numbers and an operator and calculate the result according to the following conditions:
Operator
‘+’
‘-‘
‘*’
‘/’
‘%’
Result
Add
Subtract
Multiply
Divide
Remainder