Pls check the code the tell where is the error because it is passing the given test case but not passing the hidden test case

#include
using namespace std;
int main () {
int n;
cin>>n;
int a[n];
int j=0;
int remainder;
int sum=0;
int i;
if(n<=1000 && n>0)
{
for(i=0;i<n;i++)
{
cin>>a[i];
}

	for(i=0;i<n;i++)
	{
		if(a[i]>=0 && a[i]<=1000000000)
		{
			while(a[i]!=0)
			{
				remainder=a[i]%10;
				sum=sum+remainder;
				a[i]=a[i]/10;
				
				
			}
			cout<<sum<<endl;
			if((sum%4==0 && sum%2==0) || (sum%3==0 && sum%2!=0))
			{
				cout<<"Yes"<<endl;
			}
			else
			{
				cout<<"No"<<endl;
			}
		}
		sum=0;
	}
}

return 0;

}

hi piyush
save ur code to inline ide of coding block and then post the link here

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.