Basic calculator program

TLE error.
code saved in server by name basic_calculator.cpp

Hello @singhsaurabhlps7_18d9f31919917399,

  1. while(ch!=β€˜x’ || ch!=β€˜X’) change this line it should be &&

  2. else if(ch==’%’ && b!=0) remove the condition for b, else if(ch==’%’ )

  3. else if(ch==’/’ && b!=0) remove the condition for b, else if(ch==’/’ )

Again it is showing TLE.

@singhsaurabhlps7_18d9f31919917399,

Could you pls share ide link for your code.
Also share the input you are trying to run.

link https://ide.codingblocks.com/s/652717
input *
1
2
/
4
2
+
3
2
;
X

@singhsaurabhlps7_18d9f31919917399,

You don’t have to take input a,b when ch is not equal to any character from this (+,-,*,/,%)

can you please correct the code.
I am not getting it what you are saying.

@singhsaurabhlps7_18d9f31919917399
Okay

@singhsaurabhlps7_18d9f31919917399,

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.