(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...
Before publishing your final project, clear the ____ of unused items.
a. glossary b. index c. library d. baseline
Which USMT file is generated by running ScanState.exe with the /genconfig option?
A. MigApp.xml B. MigUser.xml C. MigSys.xml D. Config.xml
The IP address of Davidprowse.com is 63.25.148.73. You can ping the IP address 63.25.148.73 but cannot ping Davidprowse.com. What is the most likely cause?
A. Davidprowse.com is down. B. The DHCP server is down. C. The DNS server is down. D. THE ADDS server is down.
When calling a function with arguments that should be modified, the __________ of those arguments are passed.
a) memory b) addresses c) values d) complements