codice:
for (int i=0; i<n; i++){
	sum=0;
	sum+=A[i]*B[i];
	i=i+1;
}
Stai riazzerando sum prima di sommare ciascun elemento...