Part II - Coding
1. [7 points] Below is program that finds the smallest value stored in an integer array. Complete
the code by filling in blanks so the program will run successfully and correctly. Use only the
pointer notation in the function min to process the array elements.
#include<iostream>
using namespace std;
int min(int *a, int length);
int main()
{
int a[]= {6,2,8,4,5};
cout<<min(a,5); //output should be 2
}//end main
//Use only pointer variable notation
int min(int ____a, int length) { //A
int i, minv=_____; //B
for(int i=1; i< length; i++)
if (_____
) //C
_____; //D
minv=_____; //E
return _____;
}