Multiplying arrays (dot vectors)
I was in need of assistance with an assignment. I have gotten help from a friend that knows how to program and yet it still isn't quite working correctly. What I need to have is a prog. that asks for the amount of numbers in an array (less then 10), then asks for the user to input these numbers into the first vector (1..4..2..5) then prompts the user to enter numbers in for the second vector. I have got most of the code but the program is not functioning properly and i am not sure of how to fix it. any assistance is helpful.
I apologize if this is sloppy, im a first year student who is trying to learn. any help is great.
int dotproduct(int a, int b, int n)
result = 0;
int n, r, a, b; // this will not allow me to compile without numbers in the array?
printf("enter number of terms: ");
printf("number entered must be less then ten, please try again:");
printf("enter first vector: ");
printf("enter second vector: ");
r=dotproduct(a, b, n);
printf("the dot product is:%d", &r);
printf("compute another dot product? (y/n) ");