Getting error during compilation

/bin/run.sh: line 4: 18 Segmentation fault (core dumped) ./exe
getting this error after compilation
here’s my code
#include
using namespace std;
int main() {
int a[100],n;

for(int i =0; i<n ; i++)
{
	int odd = 0;
	int even = 0;
	cin>>a[i];
	if(a[i]%2==0)
	{
		even=+a[i];
	}
	else
	{
		odd=+a[i];
	}
	if(even%4 ==0 || odd%3 == 0)
	{
	  cout<<"YES"<<endl;	
	}
	else
	{
		cout<<"NO"<<endl;
	}
}
return 0;

}

first you have to take n
cin>>n;

also increase size of array according to constraints

but there is no need to use array
you can solve this without array

how can i solve it withour array

im still getting the same error

Please Send the link of your code
how to send Link of Code ?
paste you code at

click on file->save->link will be generated
send the link of code generated
it will look like https://ide.codingblocks.com/s/258793

** Your Mistakes**

  1. you make size of array =10^8 that is why it is giving segmentation fault

actually your complete logic is wrong

there is no need to store car_no in array

correct way
take n make a loop form 0 to n

now inside loop
you have given car no
extract each digit from car no and add it to even or odd
now at end check the condition and print ans
look at the code given below

Modified Code

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.