Related to delhi odd even

myb code gives output for different values enev if when in submit code it shows wrong answer.
int main() {
int n;
cin>>n;
int no;
cin>>no;

 for(int i=1;i<=n;i++)
 {
	 int sum=0,p=no,r;
	 while(p>0){
		 r=p%10;
		 sum=sum+r;
		 p=p/10;
	 }
	 if(sum%2==0 && sum%4==0)
	 {
		 cout<<"Yes"<<endl;

	 }
	 else if(sum%2!=0 && sum%3==0)
	 {
		 cout<<"Yes"<<endl;

	 }
	 else{
		 cout<<"No"<<endl;
	 }

cin>>no;
}
return 0;

it is mentioned that if the sum of digits which are even is divisible by 4 or sum of digits which are odd in that number is divisible by 3. which means you need to maintain 2 sum odd_sum and even_sum and add even digits in even_sum, odd digits in odd_sum and check the condition
Code

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.