Find the maximum value and minimum value in milestracker. Assign the maximum value to maxmiles, and the minimum value to minmiles.

See Answers (1)

Suggested Answer

Python:#TODO: Update the milestracker as you wish.milestracker = [3,4,5,6,7,8,9,10,11]#Find max and min and then print those values.maxmiles = max(milestracker)minmiles = min(milestracker)print("The maximum:",maxmiles,"\nThe minimum:",minmiles)C++:#include <bits/stdc++.h>int main(int argc, char* argv[]) {    //TODO: Update the milestracker as you wish.    std::vector<int> milestracker{2,3,4,5,6,7,8,91,10,11};        //Compare and then print.    int maxmiles = *std::max_element(milestracker.begin(),milestracker.end());    int minmiles = *std::min_element(milestracker.begin(),milestracker.end());        std::cout << "The maximum: " << maxmiles << "\nThe minimum: " << minmiles << std::endl;    return 0;}

Related Question in Computers and Technology