Why this code is incorrect?

#include
using namespace std;

int main()
{
long long int a, b, c;
char ch;
cin >> ch;
while (0 <= a, b, c <= 10e8)
{
if (ch ==‘x’ || ch == ‘X’)
{
break;
}

     if (ch != 'x' || ch != 'X')
    {
        if (ch == '+')
        {
            cin >> a >> b;
            c = a + b;
            cout << c << endl;
        }
        else if (ch == '-')
        {
            cin >> a >> b;

            c = a - b;
            cout << c << endl;
        }
        else if (ch == '*')
        {
            cin >> a >> b;

            c = a * b;
            cout << c << endl;
        }
        else if (ch == '/')
        {
            cin >> a >> b;

            c = a / b;
            cout << c << endl;
        }
        else if (ch == '%')
        {
            cin >> a >> b;

            c = a % b;
            cout << c << endl;
        }
        else
        {
            cout << "Invalid operation. Try again."<<endl;
            cin>>ch;
        }

    }

   
}

return 0;

}

hey, i can see that u have successfully submitted the code and gained full points… is there anything else??

actually i have to change the code and that got passed…but initially i have given the code of the above one…why the above code is not getting passed?

while (0 <= a, b, c <= 10e8)
u cant write like this… u will have to use boolean operators if u want to write this kind of statement… the code u submitted after this is absolutely fine…

okay sir…i got it
thanks

1 Like

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.