Write a function that finds the smallest element in an array of integers using the following header:
double min(double array[], int size)
Write a test program that prompts the user to enter ten numbers, invokes this function, and displays the minimum value. Here is the sample run of the program:
```
```
include
#include
using namespace std;
double min(double list[], int size)
{
double min = list[0];
for (int i = 1; i < size; i++)
if (min > list[i])
min = list[i];
return min;
}
int main()
{
const int SIZE = 10;
double numbers[SIZE];
cout << "Enter ten numbers: ";
for (int i = 0; i < SIZE; i++)
{
cin >> numbers[i];
}
cout << "The minimum number is " << min(numbers, SIZE) << endl;
return 0;
}
```
Computer Science & Information Technology