Need help to print grids of letters
..for example
ABABA
BABAB
ABABA
BABAB
ABABA
BABAB
so when row and column numbers are the same (r == c) the program prints an A.
Any clue as to how I should approach this problem will be appreciated?
this is what i got so far..
#include <iostream>
using namespace std;
int main ()
{
int n;
cout << endl << "Enter a positive integer: ";
cin >> n;
while (n < 0)
{
exit (1);
}
for (int r = 1; r <= n; r++)
{
for (int c = 1; c <= n; c++)
{
if (r == c) cout << "A";
else if (What should i put here) cout << "?";
else if (What should i put here) cout << "?";
}
cout << endl;
}
return 0;
}