I agree that we need to see the code that you tried that did not work. Without it, we are only guessing what your problem is.
Speaking of guessing, I am assuming that you tried to add
cout << array[i][j];
somewher around line 22. If that is the case, i and j hold values that caused the program to break out of the loops (i == ROWS, j == COLS). In this case, array[i][j] returns a char that is outside of the array because the last element is array[ROWS-1][COLS-1].
If you really don't want to use a second set of nested loops, you can use a debugger to see what is stored in memory as you step through your code. Talk to your teacher about what debuggers you have available and how to use them.
Otherwise, the only ways
* to print out the contents of your array is to use a nested loop (as you did in lines 24 - 29 above) or to manually unroll it yourself, such as:
1 2 3 4
|
cout << array[0][0] << " " << array[0][1] << " " << ... << array[0][9] << endl;
cout << array[1][0] << " " << array[1][1] << ...
...
cout << array[9][0] << " " << array[9][1] << ...
| |
* You can also use a single loop and calculate the correct row and column from the loop index, but that's a little bit more complex when you already have a 2-dimensional array.