Delhi Odd Even problem

I cant find any error in my code and also i dont want to see the input. I tested on custom inpputs and it is working perfectly.

#include
using namespace std;

int main() {
int n,carno,r;
cin >> n;
for (int i=0; i<n; i++){
cin >> carno;
int temp=0;
while(carno!=0){
r=carno%10;
temp=temp+r;
carno/=10;

    }
    if((temp%2==0 && temp%4==0) || (temp%2!=0 && temp%3==0)){
        cout << "Yes\n";
    }
    else {
        cout << "No\n";
    }

}
return 0;

}

Hello @Shortcuttohell,

Read the following carefully:
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.

You are not calculating these 2 sums in your code.

  1. You have calculate the sum of all even numbers and all odd numbers separately as se and so inside the while loop.
    1.1. if r is even add it to se
    1.2. if it is odd add it to so.

  2. Outside while loop, just check se%4 && so%3

Hope, this would help.
Give a like if you are satisfied.