Write a program that will input two arrays of information


Write a program that will input two arrays of information. Each array will contain exactly 4 floating point values. Your program will enter these values from standard input. Once the values have been read in, your program should call a function that will compute the inner product of these two arrays. The function should return the value back to the main program. The main program will then print out the value. You should not print the value out inside the inner product function. The inner product of two arrays is a single number obtained by multiplying corresponding elements and then adding up their sums. 

E.g., if array u = (5, 1, 6, 2) and array v = (1, 2, 3, 4) then the inner product is 33 because (5 * 1) = 5 (1 * 2) = 2 (6 * 3) = 18 (2 * 4) = 8 and 5 + 2 + 18 + 8 is 33. 
Your main function will call a function called inner that has the following declaration: 
float innerproduct ( float u[], float v[], int size ) ;  

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that will input two arrays of information
Reference No:- TGS01675620

Now Priced at $10 (50% Discount)

Recommended (98%)

Rated (4.3/5)