Please answer this problem completely in C coding thank you. I will provide the
ID: 3697043 • Letter: P
Question
Please answer this problem completely in C coding thank you. I will provide the starter code below.
Part3. C problem: Maximum element in the array. Your code should find the maximum element present in an array. It also prints the location (index) at which the maximum element occurs in the array. Sample run is shown below Output of program: Elprogrammingsimplified.comlclmaximum-array.exe Enter the number of elements in array Enter 5 integers 4 6 Maximum element is present at location 4 and it's value is 8. Use a starter code and do not change any print statements. You can assume an intelligent user: . · . No negative number as the length of the array. Number of elements are always integers. Also, if there are duplicates, return the last occurrence.Explanation / Answer
#include <stdio.h>
int main()
{
int location;
int size,array[20],i;
printf("Input number of elements in an array");
scanf("%d", size);
printf("Enter %d integers ", size);
while(i<size);
{
scanf("%d", array[i++]);
}
return 0;
}
Int max_elem_location(int array1[20], int size1)
{
Int i,j,a;
j = I + 1;
while(i<=size1)
{
If (array1[i] > array1[j])
{
a = i;
j = i;
}
Else
a = j;
i = i + 1;
}
Return a;
}