getting wrong ans

giving
is
it
why
wrong
wrong-answer

#1

#include<stdio.h>
#include<conio.h>
int tri(int,int,int);
int a[100][100];
int s1,s2,val;

main()
{
	int n,m,i,j,sum,k;
	scanf("%d",&m);
	for(k=1;k<=m;k++)
	{
		scanf("%d",&n);

		for(i=0;i<n;i++)
		{
			for(j=0;j<=i;j++)
			scanf("%d",&a*[j]);
			printf("

");

		}
sum=tri(0,0,n);
printf("%d

",sum);
}
getch();

}

int tri(int i,int j,int n)
{
if(i>=(n-1))
{
val= a*[j];}
else
{
s1=a*[j]+tri(i+1,j,n);
s2=a*[j]+tri(i+1,j+1,n);
if(s1>s2)
val=s1;
val=s2;
}
return val;

}