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
steposvetlana [31]
4 years ago
6

Consider the following code segment. for (int a = 0; a < 10; a++) { for (int b = 10; b > a; b--) { System.out.print("#");

} } How many "#" symbols are printed as a result of executing the code segment?
Computers and Technology
1 answer:
Ket [755]4 years ago
6 0

Answer:

55

Explanation:

Given the codes as below:

  1.        for (int a = 0; a < 10; a++)
  2.        {
  3.            for (int b = 10; b > a; b--)
  4.            {
  5.                System.out.print("#");
  6.            }
  7.        }

There are two layer loops in the code. The outer loop (Line 1) will run for 10 iterations by traversing through a = 0 to a=9. However, the inner loop  (Line 3) will run for 10 + 9 +  8 + 7 +...+ 1 = 55 iterations.

Since the print statement is within the inner loop (Line 5) and therefore the number of printed "#" symbols is dependent on the number of iterations of the inner loop. There will be 55 "#" symbols printed.

You might be interested in
Tony Stark wants to build a 1000 meter high tower as quickly as possible. He has unlimited resources and an unlimited budget and
Irina-Kira [14]

Answer:

bruh is this for real. Dang if it is im sorry for wasting an asnwer. if not ill give you what i think

Explanation:

6 0
3 years ago
Read 2 more answers
Your son is complaining that his smartphone is broken. He tells you that he cannot connect to the internet, nor can he make or r
ycow [4]

Answer:

the correct and only reasonable answer is option B

3 0
2 years ago
Are Most job applications are online
Ahat [919]

Answer:

i would say yes since technology has evolved a lot over the years

Explanation:

5 0
3 years ago
To add the word "confidential" to the background of a page, users would need to _____.
KengaRu [80]
I beleive you need to insert a watermark
3 0
3 years ago
Which branch of study can help Jessica study the concept of light
Fiesta28 [93]

Answer:

Physics, Quantum Mechanics

Explanation:

Light is a stream of photons with no weight. If you want to dig deeper in this mysterious phenomena, you should study physics and quantum mechanics. Physics takes up things like the theory of relativity, which can be useful in studying spacetime and how light travels through it, and quantum mechanics, being the study of matter in an atomic level, should help you get an understanding on how photons of light travel and why they behave so strangely.

4 0
3 years ago
Other questions:
  • Members of which generation were born after the turn of the millennium?
    11·1 answer
  • Who share the road with an impaired driver are at risk
    7·2 answers
  • You're going to be mowing lawns as a summer job. How long will it take for your
    14·1 answer
  • Defining a(n) ______________ of an object is called instantiation.
    12·1 answer
  • Which part of the computer stores and processes data?
    14·1 answer
  • Decide what activity is most appropriate based on the temperature. If the temperature is greater than 80 degrees, then display t
    13·1 answer
  • III. FILL-IN THE BLANK (five points each)
    14·1 answer
  • What method of technical drawing uses converging lines?
    7·1 answer
  • To connect several computers together, one generally needs to be running a(n) ____ operating system
    6·1 answer
  • How do you answer a question on Brainly if there's already at least one answer? It should be possible, since I've seen questions
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!