Basic calculator problem qestion

how to proceed till the end

hey @royprincejmp, consider the below explanation
1.Take the first input as ch
2. Now make use of a while loop which will iterate for each input till the input is not β€˜X’ or β€˜x’:
while(ch!=β€˜X’ || ch!=β€˜x’){}
3. Inside the while use if else conditional statements:
if ch == β€˜+’:
Take two more inputs n1 and n2 (as integers) and print the addition
repeat this for β€˜-’, β€˜*’, β€˜/’, and β€˜%’
for any other input you can use else statement:
Print β€˜Invalid operation. Try again.’ inside that

@gaurav13998 how will it take input again after invalid operation

hey @royprincejmp, you can take input inside the while loop.
Take idea from this code https://ide.codingblocks.com/s/95379?_ga=2.27757237.808261274.1565180155-405277467.1563719560

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.