#include<iostream>
using namespace std;
int main()
{
int arr[5] = { 300,350,400,250,500 };
int max = 0;
for (int i = 0; i < 5; i++)
{
if (arr[i] > max)
{
max = arr[i];
}
}
cout << max << endl;
system("pause");
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int arr[5] = { 300,350,400,250,500 };
int max = 0;
for (int i = 0; i < 5; i++)
{
arr[i] > max ? max = arr[i] : max = max;
}
cout<<max<<endl;
system("pause");
return 0;
}