Code works fine for 2 cases and TLE for others
Hi @namanmittal0007,
in ur code, add cin>>op at end of ur switch . since in code, u need to take new operator after every ops.
Hope dis resolves ur doubt.
Here is d updated code.
1)write cin>>op in while loop and not in switch loop.
2)if input is n,a,b, u need to find a-b,a/b,a%b no need to check which is greater a or b
3)check the format of invalid operation.
pls refer to code
Hope dis helps.
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.