My issue
My code
// Update the program below to solve the problem
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int A,B, C;
cin>>A>>C;
if(A%2==0 && C%2 == 0){
B = (A+C)/2;
cout<<B<<endl;
}
else if( A%2 != 0 && C%2 != 0){
B= (A+C)/2;
cout<<B<<endl;
}else{
cout<<-1<<endl;
}
}
return 0;
}
Learning course: C++ for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone
why in if else statement we used = not == ?