1 test case wrong

Could you please look into my code and tell me, which test case is missing. I have ignored divide and modulo by zero condition as it is mentioned in the constraints.

#include
using namespace std;
int main() {

char ch ;

cin >> ch;

while (ch != 'x' and ch != 'X') {



	long long int n1, n2;

	switch (ch) {

	case '+':	cin >> n1 >> n2;
		cout << n1 + n2 << endl;
		break;

	case '-':	cin >> n1 >> n2;
		cout << n1 - n2 << endl;
		break;

	case '*':	cin >> n1 >> n2;
		cout << n1 * n2 << endl;
		break;


	case '/': cin >> n1 >> n2;
		cout << float(n1) / n2 << endl;
		break;

	case '%': cin >> n1 >> n2;
		cout << n1 % n2 << endl;
		break;


	default:
		cout << "Invalid operation. Try again." << endl;

	}
	cin >> ch;

}
return 0;

}

hello @raghavagrawal
remove float and then try.

Yes, its working now. But, why is it so? Because while division of int by int we will get integer as ans…what if the inputs are 5/4 and it would show 1 instead of the actual ans?

maybe because the test file contains only integer part as answer.

But, test file must contain the actual ans, as it is the correct approach.

you can check all testcases if u want.
you can find them iniside ur solution tab.

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.