Kejriwal is back with the Odd and Even Rule in Delhi. 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

#include

using namespace std;
int main()
{
int n,r,s=0,d=0;
long long int carno;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>carno;
while(carno!=0)
{
r=carno%10;
if(r%2==0)
{s=s+r;}
else
{
d=d+r;
}
n=n/10;
}
if(s%4==0||d%3==0)

     {

     cout<<"yes";}
    else
        {cout<<"no";
}
}
return 0;
}

Hey @jhaisha0003 please share your code using ide.codingblocks.com

If you don’t know how to do it, you can also ask me that.

share ur code in IDE :slight_smile:

Hey @jhaisha0003 this doubt is not in my active doubt section. You might have marked this doubt as resolved earlier. Ask it again, so that i can help you.

hello @jhaisha0003 what is the problem that you are facing?

hey @jhaisha0003 i have corrected your code and now it is giving the correct ouput.


if you dont understand anything you can ask here:
Happy Learning !!