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;
}
```
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?
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
The number of root CAs in a three-tier hierarchy is ______
a. One b. Two c. Three d. Four
Linux is an open-source program.
Answer the following statement true (T) or false (F)