In the following program you can find minimum value of an array:
#include <iostream>
using namespace std;
int min(int*, int);
int main()
{
int array[]={66,44,88,11,77,33,99,55,22};
cout<< "min(array,9)=" << min(array,9);
}
int min(int* array, int n)
{
int m=array[0];
for(int i=1;i<n;i++)
if (array[i]<m) m=array[i];
return m;
}
Comments
Post a Comment
Give your valuable Comment...