Respuesta :
Answer:
#include<iostream>
using namespace std;
//main function
int main(){
//initialize the variables
int side;
//print the message
cout<<"Please enter the side of square: ";
cin>>side; //read the vale and store in the variable.
// for loop
for(int i=1;i<=side;i++){ //lop for rows
for(int j=1;j<=side;j++){ //loop for column
cout<<"$"; //print the '*'
}
cout<<endl;
}
}
Explanation:
Create the main function and declare the variable side.
print the message on the screen for the user and then store value enter by the user on the variable side.
take the nested for loop for print the pattern.
nested for loop means, loop inside another loop it is used for print the pattern having rows and columns.
the first loop updates the row number and the second the loop print the character '