My code is giving the correct output then why after submitting its showing wrong,kindly tell ! Below is the code:
#include
using namespace std;
int main() {
int N;
cin>>N;
int n;
int cnt=0;
while(cnt<N){
cin>>n;
int ans=0;
while(n!=0){
int r=n%10;
ans=ans+r;
n=n/10;
}
if(ans%2==0 and ans%4==0){
cout<<“yes”<<endl;
}
else if(ans%2!=0 and ans%3==0){
cout<<“yes”<<endl;
}
else{
cout<<“no”;
}
cnt++;
}
return 0;
}