To solve the given problem, I am using a while loop and then using if-else statements to satisfy all the conditions given in the problem. The program is running perfectly as given in the sample output on a different code editor on my laptop but when I submit my answer the test cases are incorrect.
Not able to understand what mistake I have made
The condition if(ch == 'X'|'x')
always evaluates to true; use if(ch == 'X' || ch == 'x')
You can refer my code as well
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.