Odd even code doubt

I feel like I am dont everything right with my code or maybe I dont understand the problem. It says that if no is odd then the sum should be divisible by 4 and if the no. is even then it should be divisible by 3. right? Is there anything that I am missing

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

1 Like

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.

can you tell me what is wrong in this code
#include

using namespace std;

int main()

{

int k,o=0,e=0,n,no,i,p,q;

cin>>p;

if(p>=0 && p<=1000)

{n=p;}

for(i=0;i<n;i++)

{cin>>q;

if(q<=1000000000 && q>=0)

{no=q;}

while(no!=0)

{

k=(no%10);

no=no/10;

if(k%2==0)

{e=e+k;}

else{o=o+k;}

}

if(e%4==0 || o%3==0)

{cout<<β€œYES”;}

else{cout<<β€œNO”;

}

e=0;

o=0;

cout<<"\n";}

return 0;

}