ERROR IN MY CODE OF CALCULATOR PROBLEM
BASIC CALCULATOR QUESTION
Your mistakes
- you have to use break after each case
- when ch == x or X you have to return
- switch is not a loop
hence to take input(ch) again and again you have to use while loop
check the modified Code
i hope you doubt is resolved
if yes then plz give feedback from link below
if not feel free to ask
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.
Can u send me the code of basic calculator
i have already share the code
check above post
the code is showing test cases failed
i have one more query as we arte using break in each case it is ending the loop
i have shared meet link with you
join it
kindly give your feedback
it doesn’t take more than a min
I ask you to please rate your experience here
Your feedback is very important.
Submitted the feedback
I have one more doubt that is what does return 0 means
it symbolies normal execution of code
if code doesn’t run correctly any error comes while code is running then it return some other number other than 0
so return 0 means code runs normally
In case of x and X we gave return 0 why?
because after that we don’t want to run code further
if user press x then code should stop
hence we use return 0
Can we use break in if else statements?
yes of Couse
we can use break in if else also but only when
if else are inside the loop
We can’t use break with if else which are not in any loop
if it is not inside loop
then why you want to use break??
break is used to come out of loop
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.