Turbo sort

#include <stdio.h>
int a[10^6];
int t,c,d,swap,i;
int main(void) {

scanf("%d",&t);
for(i=0;i<t;i++)
{
	scanf("%d",&a[i]);
}
i=0;
  if(a[i]>=0&&a[i]<=pow(10,6)&&t<=pow(10,6))
  {
  
  
for(c=0;c<(t-1);c++)
{
	for(d=0;d<t-c-1;d++)
	{
		if(a[d]>a[d+1])
		{
			swap=a[d];
    		a[d]=a[d+1];
    		a[d+1]=swap;
		}
	}
}
for(i=0;i<t;i++)
{
	printf("%d\n",a[i]);
}
  i++;}

return 0;

}

Here,i am getting SIGSEGV error…can anybody suggest where i done wrong?

SIGSEGV error means a segmentation fault

Here is a wikipedia link to it :

Your mistake:-

In the first for loop you insert value in a[i] but you didn’t check the value of t before implementing it .Suppose the user enter t = (10^6+1) , but your array a can store only 10^6 values , so this leads to overflow hence the compiler shows segmentation error. First check the values of all inputs only then execute other things. C family is prone to such memory errors because it does not do bound checking , hence buffer overflows occur.