Printing the maximum numbers after user's input using Array? guys I'm struggling with this program.
here's what I wrote but it's not working..
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int maxArray[10];
int maxValue=0;
for(int j=0; j<4; j++)
{
cout<<"Enter a number: ";
cin>>maxArray[j];
if(maxArray[j]>maxValue)
{
maxValue=maxArray[j];
cout << "The highest value is: " << maxValue;
}
}
getch();
return 0;
}