hello
i want to create two arrays i have the index for them and the size
and have the dot product of a and b
and create a third array that is c[i]=a[i]*b[i]
however i tried to do it but the output doesn't come the correct :(
import java.util.Scanner;
public class JavaApplication09 {
static Scanner input = new Scanner (System.in);
public static void main(String[] args) {
int a [] = {1,2,3,4,5};
int b [] = {6,7,8,9,3};
int c [] = null;
for (int i=0;i<a.length;i++){
c[i]+= (a[i]*b[i]);
}
}
}
can someone help what i did wrong ??