WHY THIS IS NOT GETTING RIGHT?\

THIS WORKS IN MY COMUPTER BUT NOT WORKING IN CODING BLOCKS IDE
#include
using namespace std;

int main()
{
int n,i,k,sum;
cin>>n;
for(i=0;i<n;i++)
{
sum=0;
cin>>k;
for(int j=0;k!=0;j++)

	{
		sum=sum+k%10;
		k=k/10;
	}
	if(sum%4==0)
	{
        cout<<"Yes"<<endl;
	}
	else if(sum%3==0)
	{
		 cout<<"Yes"<<endl;
	}
	else 
	cout<<"No"<<endl;
}


return 0;

}

hello @dhruvilcodes

pls read this statement carefully->
image

also next time onwards pls use cb ide for code sharing

@dhruvilcodes
u need to calculate even digits sum and odd digits sum separately , and
then if even sum is divisible by 4 or odd sum is divisble 3 , car is allowed otherwise not.

u r calculating only sum without considering even or odd.
refer this->

1 Like

Thank you so much sir! got my mistake!!!1

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.