Code changes .........,,,,,

#include
using namespace std;
int main() {
int t;
cin>>t;
int n;
while(t–){
cin>>n;
int q,rem;
int sum=0;
q=n;
while(q!=0){
rem=q%10;
sum+=q;
q=q/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;
	}

}
return 0;

}

hey @neelrai906 it is mentioned in the question that you need to print yes when sum of odd digits modulo 3 is zero or sum of even digits modulo 4 is zero. you should maintain 2 sum, one for odd and one even and if the remainder is odd add it to odd sum and if it is even add it it even sum and then check if odd_sum%3 == 0 OR
even_sum%4 == 0, if it is print Yes else No

code changes suggestion;

#include
using namespace std;
int main() {
int t;
cin>>t;
int n;
while(t–){
cin>>n;
int q,rem;
int cnt=0;
int sum=0;
q=n;
while(q!=0){
rem=q%10;
sum+=q;
q=q/10;
cnt++;

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

}
return 0;

}

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.