1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ryzh [129]
2 years ago
13

Write a C++ programthat reads in the side of a square and prints out a pattern on$

Computers and Technology
1 answer:
AnnZ [28]2 years ago
7 0

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 '$' in the column-wise.

in the code,

if i = 1, for loop check the condition 1 <= 5 if the value of side is assume 5.

condition is true and the program moves to the second for loop and starts to print the character '$' five times after that, print the new line.

then, the above process repeat for different rows and finally, we get the pattern in square shape.

You might be interested in
Network forensic analysis. A network forensic analyst is responsible for identifying worms, viruses, and infected nodes in the c
Phantasy [73]
<h3>What is Network forensics ?</h3>

Network forensics is the procedure of tracking packets and reading community site visitors hobby for intrusion or malware detection. It entails figuring out an issue, amassing and reading data, choosing the great troubleshooting response, and imposing it.

The probability distribution is 1.25.

Read more about the probability distribution:

brainly.com/question/24756209

#SPJ1

5 0
2 years ago
Difference between entropy and enthalpy is
olchik [2.2K]

Answer:

Explanation:

Enthalpy is the measure of total heat present in the thermodynamic system where the pressure is constant. Entropy is the measure of disorder in a thermodynamic system.

3 0
2 years ago
Tim is in charge of the upcoming interschool baketball tournamnent. He wants to arrange all of the teams and their members in al
zalisa [80]
I think the answer is C.
7 0
2 years ago
Ano ang dalawang paraan sa paggawa ng abono?​
Bas_tet [7]

Answer:

im sorry i dont understand

Explanation:

5 0
2 years ago
In which area is composing for games different from composing for movies?
kondaur [170]

Answer: royalties earned

Explanation:

In areas such as the looping scores, temp tracks and adaptive scores, there are similarities when composing for games and when composing for movies.

The area where there is difference when composing for games and composing for movies is the royalties earned. The interest that is earned on royalties for both cases are different.

8 0
2 years ago
Other questions:
  • Scavenging is a form of fraud in which the perpetrator uses a computer program to search for key terms in a database and then st
    14·1 answer
  • Open source software is copyrighted software that is distributed at no cost for a trial period.
    11·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·1 answer
  • What is the name for a partition that has been formatted and assigned a drive letter?
    8·1 answer
  • Cloud computing allows organizations to rent computing resources from providers instead of having their own locally managed ____
    7·1 answer
  • Jeremy is working with a team that is creating an application using attributes and associated methods. What type of programming
    8·1 answer
  • A natural language processor reads the sentence The walk was tiring and mistakes the noun “walk” as a verb. What is such an erro
    13·1 answer
  • What is the main function of the output on a computer or what is it use for? ​
    15·2 answers
  • rue or false: The first web browser was introduced to the public in the 1970s and started the explosive growth of the Internet i
    15·1 answer
  • Consider the following code using the posix pthreads api:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!