get max value with indices c++ code example Example: find max value in array c++ cout << " max element is: " << *max_element(array , array + n) << endl;