Can you see whats wrong with my code its giving wrong ans

Hey on line 5 it should be

if(count==n-1)

Otherwise you will try to access a[n] in next statement which is wrong
Also on line 11 it should be

return galat(a,n,count+1);

1 Like