0

[WHAT IS WRONG] Calculating two numbers using the operator inputted by the user

https://code.sololearn.com/cX548fjFzmID/?ref=app

7th Oct 2021, 9:55 AM
ruiririririri
ruiririririri - avatar
2 odpowiedzi
+ 1
Hi Alena Sherine ! I see. Thank you for informing me. Have a nice day!
7th Oct 2021, 10:11 AM
ruiririririri
ruiririririri - avatar
0
Actually u did silly mistakes first error is the variable which u have decleared for choice operator its predefined and u cannot use it as a variable name then your second mistake is where u have written input statement scanner then u used variable sc and later u taking input via s variable here variable not matching with declared one . other things are fine Note : why u writting calculation part addition subtraction.... in header why not in cases like case '+': { logic for addition it will be more understandable who will read your code } https://code.sololearn.com/cS86M4rYXG9b/?ref=app
7th Oct 2021, 10:06 AM
A S Raghuvanshi
A S Raghuvanshi - avatar