for(auto value : data)
cout << setw(6) << value;
cout << endl;
return 0;
}
// Function returning a reference
double& lowest(double a[], const int& len)
{
int j(0); // Index of lowest element
for(int i = 1; i < len; i++)
if(a[j] > a[i]) // Test for a lower value...
j = i; // ...if so update j
return a[j]; // Return reference to lowest element
}
*I need help in understanding how the function works in this program. I am confuse in how the for loop works in the function that indicates the lowest value in the array. Thanks in advance