Delhi odd even: Test case is not passing

#include < iostream>
using namespace std;
int main() {
int n;
cin>>n;
long int k;
for (int l=1 ; l<=n ; l++) {
cin>>k;
int even=0;
int odd=0;

	    for (int j=0 ; k>0 ; j++) {
             int val=k%10;
			 val%2==0 ? even+=val : odd+=val;
			 k=k/10;
		}
		if ((even%4==0) || (odd%3==0)){
			cout<<"YES"<<endl;
		}
		else {
		    cout<<"NO";
		}
	}

return 0;

}

@Maazkhan give line break after printing “NO”.

yeah , it worked . thank you

1 Like

@Maazkhan happy to help.mark this doubt as resolved if you dont have any further queries.

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.

It isn’t appearing in ‘My doubts’ section and i cant find the option anywhere else, tell me how do i mark it resolve and give feedback.

@Maazkhan it is not appearing in your “my doubt” because i have marked it as resolved. from next time if your doubt get cleared mark and the TA have not mark that as resolved it will show in your “my doubt” section then you can mark that as resolved and can give feedback.

1 Like