#include #include using namespace std; const int n = 5; // array size double x[n] = {15.1, 33., 0.3, 42.5, 8.8}; // array of doubles int main() { double x_max = x[0]; // max. of x initialized by entry 0 for (int i=1; i x_max) // entry i > current maximum? x_max = x[i]; // replace current maximum } cout << x_max << endl; }