Basic Calculator Doubt1


in Challenges - Fundamentals and patterns question - Basic Calculator i wrote the above code and it is showing the output below :
TESTCASE # 1 : wrong-answer (Time: 0.06 s)
TESTCASE # 2 : run-error (Time: 0.05 s)
TESTCASE # 3 : run-error (Time: 0.05 s)
TESTCASE # 4 : wrong-answer (Time: 0.06 s)
TESTCASE # 5 : correct (Time: 0.05 s)
TESTCASE # 6 : correct (Time: 0.07 s)

Can you p;ease tell what.s wrong in my code.
Also it is not clear in the question what to do when the N2=0 in case of division and modulos

Hi @nirbhayvashisht

The conditions for n2 are clearly mentioned in constraint.
Your code doesn’t work right for sample I/O. Your code needs to print the output for all the operators.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.