double calcMax (double arr[], unsigned arrSize) { unsigned idxMax = 0; for (unsigned i = 0; i < arrSize; ++i) { if (arr[i] > arr[idxMax]) { idxMax = i; } } return (arr[idxMax]); }