TLE (Infinite Loop)

I am getting a TLE in the challenge- Basic Calculator. ‘x’ or ‘X’ should terminate the program and I am making a mistake in the same.
My program- https://ide.codingblocks.com/s/55496

Hi Dhruv, just take a boolean variable and set it to true initially. Run the do-while loop while(y==true). As soon as you encounter a ‘x’ or ‘X’, set y=false and break from the while loop.

I’ve made these changes to your code, you can refer to it here: https://ide.codingblocks.com/s/55620

Thank you for your solution. It is working perfectly now.