Test case not passes delhi odd even

I GOT CORRECT OUTPUT BUT TEST CASE FAILED.

int n,no,last;
cin>>n;
for(int j =0; j<n;j++){
int sum=0;
cin>>no;

for(int i=0;no!=0;i++){
	  last = no%10;
	  sum =sum + last;
	  no = no/10;	  	  
}	

if((sum%2==0 && sum%4==0 ) || (sum%2!=0 && sum%3==0)){
	cout<<"yes"<<endl;
	  
}
else{
	cout<<"no";
}

}
PLEASE HELP!

Hi @Diwyanshu
See in this you have to calculate sum of even digits and odd digits separately and then compute if sum of even digits is divisible by 4 or sum of odd digits is divisible by 3 then print yes else print no.

Here is your corrected code :

new code ;;;;;;;;;;;;;;;;;;;;;; int main() { int n,no=0; cin>>n; for(int j =0; j<n;j++){ cin>>no; int sumeven=0; int sumodd=0; int last = 0; for(int i=0;no!=0;i++){ last = no%10; if(last%2==0){ sumeven =sumeven + last; } else{ sumodd = sumodd + last; } no = no/10; } if(sumeven%4==0 || sumodd%3==0){ cout<<β€œYes”<<endl; } else{ cout<<β€œNo”; } } return 0; } PLEASE HELP

There should be endl after printing No.

thanks for help bhaiya