0

how to make calculator?

15th Jul 2016, 6:25 AM
Piyush Anand
Piyush Anand - avatar
4 Answers
+ 2
you can make a calculator using switch case. case1: + case2: - and so on... let user input two variables and then choose operation via switch and display result.
15th Jul 2016, 9:45 AM
SIDDHARTH VASU
SIDDHARTH VASU - avatar
0
Firstly u can simply show the menu in which show what are the choices like addition, subtraction n all.. and ask the user to select the choice like ➕ or ➖.. Then using switch and break u can simply make different cases for ➕, ➖ etc and write down it's logic there.. Then can make a default case for making wrong input..
15th Jul 2016, 6:47 AM
yashmi
0
use arithmetic operation like +,-,*,/,%
16th Jul 2016, 7:58 AM
karthick abishek
karthick abishek - avatar
- 2
You need object oriented programming for that.
15th Jul 2016, 6:46 AM
Anik Sarker
Anik Sarker - avatar