+ 10

Can we assign "+,-,*,/" as a variable to take input for an basic calculator in c++

22nd Oct 2017, 8:45 AM
lollz
5 Answers
+ 5
It's not allowed to use spesial symbol like+- etc
2nd Feb 2018, 6:33 AM
Nurman Tajir
Nurman Tajir - avatar
+ 4
We cannot take an operator as a name for a variable... variable names can only start with an alphabet or an underscore and won't have an operator in them... To create a basic calculator something like this can be done.. int main(){ int x,y,sum; cout << "enter two nos. for addition:" cin >> x; cin >>y; sum=x+y; cout <<sum; } and the remaining operations can be done similarly
29th Jan 2018, 5:35 PM
Dew See 33
Dew See 33 - avatar
+ 1
we can no assign "+,-,*,/" as variable name.
10th Jan 2018, 5:33 PM
Jatin Hirapara
Jatin Hirapara - avatar
0
variables always start with some alphabets (a - z)
11th Jan 2018, 2:31 AM
Dinesh Chauhan
Dinesh Chauhan - avatar