Why this '+' symbol is not working?
The '/' symbol is working properly but '+' symbol isn't working. When i was writing code, i have done number= num and showing the answer like 1+ 1 = 11 but now i have added number == num it is not showing, it is showing only divide. Please help me: https://code.sololearn.com/WT8Lob2UZuD4/?ref=app
6/24/2021 4:12:58 AM🔥🅳🅴🆅 🅼🅸🆂🅷🆁🅰🔥
2 AnswersNew Answer
The first reason is for not working it because in your code you have declared if(symbol= "/") that's why the symbol will become / so that's why your code won't work. You should declare if(symbol=="/") also you should print the answer either in alert or console, not both. The second reason is like @Allan told you.You should parse your input as an int or float to get the accurate answer. After fixing your code,it would be something like this: https://code.sololearn.com/Wa4A14a25A11