(Checkerboard Pattern of Asterisks) Write a program that displays the checkerboard pattern shown below. Your program must use only three output statements, one of each of the following forms:
cout << "* ";
cout << ' ';
cout << endl;
********
********
********
********
********
********
********
********
```
// Prints out an 8 x 8 checkerboard pattern.
#include
using namespace std;
int main()
{
int row = 8; // row counter
int side; // side counter
while ( row-- > 0 ) // loop 8 times
{
side = 8; // reset side counter
// if even row, begin with a space
if ( row % 2 == 0 )
cout << ' ';
18
while ( side-- > 0 ) // loop 8 times
cout << "* ";
cout << endl; // go to next line
} // end while
} // end main
```
You might also like to view...
Line weight is the thickness of a line as measured in ________
A) points B) millimeters C) pixels D) centimeters
Progressive design provides a technique for creating one website that automatically adjusts to the screen size of the viewing device. ____________________
Answer the following statement true (T) or false (F)