Question: In the following code theres a function that takes an integer array and assigns new values to its entries; and the main program that calls
In the following code theres a function that takes an integer array and assigns new values to its entries; and the main program that calls the function. Corrections in which lines are necessary so that this function works properly? Select all that apply.
1 #include (stdio.h)
2 int ChangeArrayElements(int arr, int length)
3 {
4 for (char i=1; i 5 { 6 arr[i] = arr[i-1]+5; 7 } 8 } 9 10 int main 11 { 12 int A = {1, 2, 3, 4, 5}; 13 ChangeArrayElements(A); 14 for (int i=0; i<5; i++) 15 { 16 printf( %d , A[i] ); 17 } 18 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
