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

Write and demonstrate a Lambda function named stg() that appends .txt to its argument. What happens when you call the function with an integer?

What will be an ideal response?

Computer Science & Information Technology

If switch A has an interface configured in dynamic auto mode that is connected to switch B, in which mode does switch B's interface need to be configured to ensure the link between them becomes a trunk?

A) Trunk B) Auto C) Dynamic D) Desirable

Computer Science & Information Technology

The number of root CAs in a three-tier hierarchy is ______

a. One b. Two c. Three d. Four

Computer Science & Information Technology

Linux is an open-source program.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology