getting a runtime error, can anyone help me out in this?
code:
#include <stdio.h>
void main(){
int a[10^6];
int i,t,n;
scanf("%d",&t);
while(t–){
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
sort(a,n);
for(i=0;i<n;i++)
printf("%d",a[i]);
}
}
int sort(int a[10^6],int n)
{
int i,j,temp;
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
return 0;
}