Answer:
Algorithm:
1.Create a variable "maxx" and initialize it with INT_MIN.
2.Create an array of size 500.
3.for i=0 to 499.
3.1 Read value from user and store in array.
3.2 if input >maxx.
3.3 maxx=input.
4.maxx will have the largest of all 500 numbers.
5.end program.
Implementation In C++:
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable
int maxx=INT_MIN;
// array of size 500
int arr[500];
cout<<"Enter 500 numbers:";
for(int i=0;i<500;i++)
{// read input number
cin>>arr[i];
// find maximum
if(arr[i]>maxx)
maxx=arr[i];
}
// print maximum
cout<<"Maximum of all:"<<maxx<<endl;
return 0;
}