Help me in solving LBCV201 problem

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 == ?

@shrutisingh777

  1. if (A%2 == 0 && C%2 == 0) - this has ==

  2. else if( A%2 != 0 && C%2 != 0) - this has != because it is ‘not equal to’.