Help me in solving ODDSUMPAIR problem

My issue

if i check for all the three numbers to be even then there will be no. same applies when all the three numbers are odd. for other cases output will be yes. but i am getting a no for the first case. what could be the mistake?

My code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int T;
	cin>>T;
	while(T--){
	    int a,b,c;
	    cin>>a>>b>>c;
	    if(a%2==b%2==c%2==0){
	        cout<<"no"<<endl;
	    }
	    else if(a%2!=0 && b%2!=0 && c%2!=0){
	        cout<<"no"<<endl;
	    }
	    else{
	        cout<<"yes"<<endl;
	    }
	}
	return 0;
}

Problem Link: Odd Sum Pair Practice Coding Problem - CodeChef

The program starts by reading the number of test cases (T) from the standard input.
It then enters a loop that iterates T times, where each iteration represents a test case.
Inside the loop, it reads three integers a, b, and c for the current test case.
The program checks a condition related to the parity of a, b, and c using the modulus operator %.
It prints “no” if the condition is satisfied, otherwise, it prints “yes.”
The loop continues until all test cases are processed.

U simply write

If(a+b)%2==1 ||(b+c)%2==1||(a+c)%2==1)
Cout <<yes;
Else
Cout no

1 Like

include
using namespace std;

int main() {
// your code goes here
int T;
cin>>T;
while(T–){
int a,b,c;
cin>>a>>b>>c;
if((a+b)%2==1||(b+c)%2==1||(a+c)%2==1){
cout<<“YES”<<endl;}

    else{
        cout<<"no"<<endl;
    }
}
return 0;

}