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;
}
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.