Segmentation Fault

#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,T;
long int N[1000000],S[1000000];
scanf("%d",&T);
for(i=0;i<T;i++)
{
scanf("\n%d",&N[i]);
}
for(j=0;j<T;j++)
{
S[j]=N[j]+1;
}
for(k=0;k<T;k++)
{
printf("%d\n",S[k]);
}
getch();
return 0;
}

no need of conio.h ofr online submission on codechef
also getch not required

Declare the two arrays outside the main function.

i wrote this code for offline ide