If i want to print a grid of letters..for example

AAAAA
BBBBB
AAAAA
BBBBB
AAAAA

this is what I got so far. need some clues as to how I should approach the problem?

#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 == 1)    cout << "A";
            else if (c == 1)    cout << "B";
            else                cout << " ";
        }
        cout << endl;
    }
    return 0;
}

this is what i get as output

Enter a positive integer: 4
AAAA
B
B
B

solved!

#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 % 2 != 0)    cout << "A";
            else if (r % 2 == 0)    cout << "B";
            else                    cout << "?";
        }
        cout << endl;
    }
    return 0;
}
This question has already been answered. Start a new discussion instead.