0
[WHAT IS WRONG] Calculating two numbers using the operator inputted by the user
2 Antworten
+ 1
Hi Alena Sherine ! I see. Thank you for informing me. Have a nice day!
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