(Square of Asterisks) Write a function that displays at the left margin of the screen a solid square of asterisks whose side is specified in integer parameter side. For example, if side is 4, the function displays the following:
****
****
****
****
What will be an ideal response?
```
// Displays a solid square of asterisks.
#include
using namespace std;
void square( int ); // function prototype
int main()
{
int side; // input side length
cout << "Enter side: ";
cin >> side;
cout << '\n';
square( side ); // display solid square of asterisks
cout << endl;
} // end main
// square displays solid square of asterisks with specified side
void square( int side )
{
// loop side times for number of rows
for ( int row = 1; row <= side; row++ )
{
// loop side times for number of columns
for ( int col = 1; col <= side; col++ )
cout << '*';
cout << '\n';
} // end for
} // end function square
```
You might also like to view...
A 3-D pie chart is a three-dimensional disk divided into wedges that resemble pieces of a pie
Indicate whether the statement is true or false
You can customize the Ribbon by creating new groups on existing tabs, but you CANNOT create new tabs
Indicate whether the statement is true or false