Even Fibonacci Numbers - Project Euler ,Getting some error (Segmentation Fault(core dumped)) Here is the code, Can anyone help to find the mistake ?
int main()
{
int arr[4000000];
int i,sum=0;
arr[0]=1;
arr[1]=2;
for(i=2; i<4000000; i++)
{
arr[i] = arr[i-1] + arr[i-2];
}
for(j=0; j<4000000; j++)
{
if(arr[j]%2==0)
{
sum = sum + arr[j];
}
}
return 0;
}