Question: Please help me to do this on C program: Write a function named VectorPlusVector to compute the element by element sum of two vectors. The

Please help me to do this on C program:

Please help me to do this on C program: Write a function

Write a function named VectorPlusVector to compute the element by element sum of two vectors. The desired output is a vector, but since we can't output a vector from a C function, we will declare the results vector as a global variable. Inputs: 1. Input vector 1 (double) 2. Input vector 2 (double) 3. Length of vectors (int) Output: None! (See explanation above.) Function pseudocode: Use a for loop to add each element in input vector 1 to the corresponding element in input vector 2 and assign the sum to the corresponding element in the global results vector. Prototype your function above main() so that the function itself can come after main(). Intrusions for main(): Call your function from main() with {1.1, 2.1, 3.1, 4.1, 5.1} and {1.5, 1.4, 1.3, 1.2, 1.1} as the input vectors, and a length of 5. Use printf inside a for loop to print the values of the results vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!