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:

```

Enter ten numbers: 1.9 2.5 3.7 2 1.5 6 3 4 5 2
The minimum number is: 1.5

```

```
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

You might also like to view...

What is the value of numbers.size() after the following code? vector numbers(100);

a. 0 b. 10 c. 100 d. unknown

Computer Science & Information Technology

What are the benefits to using a layered approach?

What will be an ideal response?

Computer Science & Information Technology