I need help writing a program to fill ten integer numbers into an array and print out the maximum number. If some one could help ASAP i have to turn this code in at 3 thanks.
#include <iostream>
#include <algorithm>
constexprauto SIZE = 10;
int main()
{
int arr[SIZE] {};
for (auto i = 0; i < SIZE; ++i)
{
std::cout << "Enter number " << i + 1 << "\n";
std::cin >> arr[i];
}
std::cout << "The largest array element is " << *std::max_element(arr, arr+SIZE) << "\n";
}
edit: some input validation makes more robust program