Question: what is the error for this code and why this is an error? The function assign_vals () takes 2 parameters: an array of type double

what is the error for this code and why this is an error?

what is the error for this code and why this is an

The function assign_vals () takes 2 parameters: an array of type double and an int. It then calculates and prints out the result of 2*i+1 and does not return anything. However, the code produces the wrong output when executed as shown in the figure below. Rewrite the single line of code that will fix this bug. 8 main.c 1 #include 2. 3 void assign_vals(double xx[], int num_of_elements); 4- int main() { 5 int N = 10; 6 double arr_xx[N]; 7 arr_xx = assign_vals(arr_xx, N); 9 10 return 0; 11 } 12 13 - void assign_vals(double xx[], int num_of_elements) { 14 int i=0; 15 - for (i=0; i

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!