Write a program that inputs two integer vectors, computes the dot product of the vectors, and displays the results. The dot product of two vectors is calculated by summing the product of corresponding terms. For example:
[ 1 3 5 ] · [ 2 4 6 ] = 1·2 + 3·4 + 5·6 = 44
Allow for up to 100 elements per vector, and store each vector in an array. After displaying the dot product, ask the user if they want to compute another dot product. Here is a sample run:
Enter number of terms: 3
Enter first vector: 1 3 5
Enter second vector: 2 4 6
The dot product is 44
Compute another dot product? (y/n) n
computer: Good-bye!
Implement the dot product logic as a function using the following prototype:
int dotProduct(int a[], int b[], int n);
where a and b are the two vectors, and n is the number of terms in each vector