Delhi odd even - covered all the test cases and but submission problem

#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,x; // number of cars
cin>>n;
int i=0;
int car_no;
int temp,sum=0 ;
while(n!=0)
{
cin>>car_no;
temp=car_no;
while(temp>0)
{
x=temp%10;
sum=sum+x;
temp=temp/10;
}

	if(sum%2==0)
	{
		if(sum%4==0)
		{
			cout<<"yes"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	if(sum%2!=0)
	{
		if(sum%3==0)
		{
			cout<<"yes"<<endl;
		}
		else
		{
			cout<<"no"<<endl;
			
		}
	}
	n--;
}
return 0;	

}