What exactly is wrong with this section of code. All I want to do is read in numbers into a 4X4 array and then output them to the screen in a 4X4 pattern. Please let me know what I am doing wrong ASAP. Thanks!
P.S. Is there a way to enter the numbers by row (separated by spaces) instead of each individual like I am doing? If so, how? Thanks again!
#include <iostream.h>
#include <iomanip.h>
int main()
{
int grid[4][4]={0};
bool magic = true;
int row, col;
for(row=0; row<4; row++)
{
for(col=0; col<4; col++)
{
cout << "Please enter the value for row " << row << ", col " << col << ": ";
cin >> grid[row][col];
}
}
for(row=0; row<4; row++)
{
for(col=0; col<4; col++);
{
cout << grid[row][col];
}
cout << endl;
}
return 0;
}