Dec 4, 2013 at 2:07pm
Hi Shebbo Muhammed,
you could use setw(int) as in:
std::cout << std::setw(5);
before printing a value, in your case before:
cout << AB[row][col] << endl;
you could write like this:
1 2 3 4 5 6 7 8 9
|
for (int row=0; row<2; row++)
{
for (int col=0; col<3;col++)
{
cout << setw(5);
cout << AB[row][col] << " ";
}
cout << endl;
}
|
Last edited on Dec 4, 2013 at 2:07pm