What’s wrong here, please give me hint.
Calculator problem
@aman212yadav, please check the code again, It’s showing error.
runguard: warning: timelimit exceeded (wall time): aborting command
runguard: warning: command terminated with signal 15
try running on some other compiler it is working fine.
dont know why it is showing such error on cb ide.
try to run it here-> link
yea, its running outside compiler.
pls try again after sometime, even editorial code is producing same error
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.
@aman212yadav, sir last question.
Why did you mention condition like this using &&,
while(ch != ‘X’ && ch != ‘x’)
Why did you use &&? Please help with this.
Because we want to check condition either ch is “X” or ‘x’.
when should we execute our while loop.
?
we should ezecute when ch is neither x nor X .
that is why ch!=x and ch !=X is there in the conditiom
@aman212yadav,
Oh, at some point I got it.
Still, I’m confused.
why both conditions must hold true?
We are only reading ‘ch’ that can contain ‘x’ or ‘X’ to exit the program.
in case of or , ur loop will never terminate
becuase if ch is x then also this ch!=X conditiom will hold true and loop will continue its execution