const int MAX_A = 3;
const int MAX_B = 4;
//declare two dimensional array
int numbers[MAX_A][MAX_B];
int main()
{
// declaring variables
using namespace std;
int MAX_A = 3;
int MAX_B = 4;
int numberArray[3][4];
// asking the user to input data & storing in array
cout << "This program will take the user's input and store into an array." << endl;
cout << "Please enter any number, up to a series of 12 numbers..." << endl;
// declaring two-demensional array
for (int i=0; i < MAX_A; i++)
{
for (int j=0; j < MAX_B; j++)
{
while(1) // keep trying until we get a valid input
{
cout<<"Enter a number: "<<endl;
cin>>numberArray[i][j];
if (!cin)
{
cout << "Please enter a real, positive number." << endl;
// clean up the stream to remove the everything entered up to that point
}
else
break; // if we got a number, break the innermost loop
} // error checking loop
} // MAX_B loop
} // MAX_A loop
// print the array and the greatest value
for ( int i=0; i < MAX_A; i++) {
for (int j=0; j < MAX_B; j++){
cout << numberArray[i] [j] << "";
}
cout << endl;
}
system("PAUSE");
int highest = 0;
for ( int i=0; i< MAX_A; i++){
for (int j=0; j < MAX_B; j++){