I think the code is correct yet 4 tests failed.
4 Tests Failed but the code seem correct
Gautam your code is not producing the correct result as per sample case. The output of sample test case is
2
2
5
Invalid operation. Try again
But your code is functioning only once, since you are passing character using a switch only once. Use do while loop before passing the character to switch, since it is mentioned in question that you have to take input only if ch is among ‘+’, ‘-’, ‘*’, ‘/’ or ‘%’