View Single Post
  #2 (permalink)  
Old March 5th, 2006, 04:00 PM
C@uark C@uark is offline
Authorized User
 
Join Date: Oct 2004
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to C@uark
Default

Try this,

int main()
{
    int column=16;
    int row=8;

    for (int counter = 0; counter < row; counter++){
        if ( counter % 2 == 0 ) // if even row shift one space
            cout << " ";
        for (int count = 0; count < column; count++){
            if ( count % 2 == 0)
            cout << "*";
            else
                cout << " ";
        }
    cout << endl;
    }
    return 0;
}
Reply With Quote