Write a program in C++ for finding the maximum Number of an array - WAY2IT

Latest Post :

Write a program in C++ for finding the maximum Number of an array



Code :-

#include <iostream.h>
#include <conio.h>
int main()
{
// The members of the array
int numbers[] = {8, 25, 36, 44, 52, 60, 75, 89};
int maximum = numbers[0];
int a = 8;
// Compare the Numbers
for (int i = 1; i < a; ++i) {
if (numbers[i] > maximum)
maximum = numbers[i];
}
// Announce the result
cout << "The highest Number value of the array is "<< maximum << "." <<endl;
getch();
return 0;
}