I am getting run time error for the below code :     #include<stdio.h>
    #include<stdlib.h>
    int main(){
	int i,j,a[10],result=0,p;
	int *m=malloc(sizeof(int)*8);
	for(i=0;i<10;i++){
	scanf("%d",&a[i]);
	result+=a[i];}
		//printf("%d\n",result);
		//printf("\n");
	//	for(i=0;i<8;i++){
				for(j=0;j<9;j++){
	scanf("%d",&m[j]);
	result=result-m[j];
	p=result/2;}
	return p;
	}
In this code i am runtime error.Any help would be appreciated.THanks!