Question-
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:
Sample Screen Display
****
****
****
****
i have come this far but i get the output
*
*
*
*
*
*
if i put in side as 2
here is my code
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main ()
{
int side;
cout << "This program will display a solid square of asterisks whose side is specified by the user." << endl;
cout << "Please enter an integer specifying the length of the side." << endl;
cin >> side;
for ( int i = 0 ; i < side ; i++)
{
cout << " * " << endl;
for ( int j = 0 ; j < side ; j++)
{
cout << " * " << endl;
}
}
return 0;
}