Question is
Due to growing Traffic Problem Kejriwal wants to devise a new scheme. The scheme is as follows, each car will be allowed to run on Sunday 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. However, to check every car for the above criteria can’t be done by the Delhi Police. You need to help Delhi Police by finding out if a car numbered N will be allowed to run on Sunday?
My program
#include
using namespace std;
int main()
{
/* int arr[1000];
int n;
long long x,y;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
for(int i=0;i<n;i++)
{
x=0;
y=0;
while(arr[i]!=0)
{
x=arr[i]%10;
arr[i]=arr[i]/10;
y=y+x;
}
if(y%4==0||y%3==0)
{
cout<<“Yes”<<endl;
}else
cout<<“No”<<endl;
}*/
int t,n;
long long x,y,z;
cin>>t;
while(t!=0)
{
x=0;
cin>>n;
while(n!=0)
{
z=0;
y=0;
x=n%10;
n=n/10;
if(x%2==1)
{
z=z+x;
}
else
if(x%2==0)
{
y=y+x;
}
}
if(y%4==0||z%3==0)
{
cout<<“Yes”<<endl;
}else
{
cout<<“No”<<endl;
}
//else{
//break;
//}
t–;
}
return 0;
}
here is my code please tell me the solution .