https://i.stack.imgur.com/kU6lD.png
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i,n,*a=(int*)malloc(n*sizeof(int));
scanf("%d",&n);
for(i=0;i<n;++i)
scanf("%d",(a+i));
for(i=0;i<n;++i)
printf("%d",*(a+i));
free(a);
return 0;
}
the above program run smootly till input(i.e. n) is less than or equal to 6.If I input n greater than 6 then it is showing runtime error.WHY?here runtime error depends on value of input??)