Question: Below lines implement a function that takes an integer array and multiplies each entry with itself (squares each element in array), and the main program
Below lines implement a function that takes an integer array and multiplies each entry with itself (squares each element in array), and the main program that calls the function. Corrections in which lines are necessary so that this code works properly? Select all that apply.
1 #include (stdio.h)
2 int SquareArrayElements(int arr, int length)
3 {
4 for (char i=0; i
5 {
6 arr[i] = arr[i]*arr[i];
7 }
8 }
9
10 int main
11 {
12 int A = {1, 2, 3, 4, 5};
13 SquareArrayElemens(A);
14 for (int i=0; i<5; i++)
15 {
16 printf( %d , A[i] );
17 }
18 }
Yantnz:
1
2
4
6
10
12
13
14
16
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
