I am soving this problem of Maj element in the array why is it showing segmentation fault(core dumped)

#include
using namespace std;

int main()
{
int a[10000000]={5,5,0,0,5,5,4,5,3};

int n=sizeof(a)/sizeof(int);


int maj=(n/2);

int count=0;
int element=0;
for(int i=0;i<n;i++)
{


	if(count==0)
	{
		element=a[i];
	}
	if(a[i]==element)
	{
		count++;
	}
	else
	{
		count--;
	}

}

count=0;

for(int i=0;i<n;i++)
{
	if(a[i]==element)
	{
		count++;
	}
}

if(count>maj)
{
	cout<<"The majority element is "<<element<<endl;

}

else
{
	cout<<"No majority element present"<<endl;
}

return 0;
}

@Subrat,
Array size is too big.

Yeahh i got it thanxxx