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
Four example of computer software?​
rodikova [14]

<em>answer</em><em>=</em><em> </em><em>safari</em><em>,</em><em> </em><em>ms</em><em>-</em><em>word</em><em>,</em><em> </em><em>moviemaker</em><em>,</em><em> </em><em>ms</em><em>-</em><em>pain</em><em>t</em><em>,</em><em> </em><em>firefox</em><em>,</em><em>etc</em><em>.</em><em>.</em><em>.</em>

5 0
3 years ago
In your own words, explain the FNAF timeline
tatiyna

Answer:

see shawty problem is, I havent had that phase yet, my cousin would be able to answer this tho

3 0
3 years ago
Ill give brainliest if possible
AlekseyPX
I can’t see that zoom it in
8 0
3 years ago
Read 2 more answers
What is the purpose of the SMTP command "HELO"
sergij07 [2.7K]
If a client initiates the SMTP communication using an EHLO (Extended Hello) command instead of the HELO command some additional SMTP commands are often available. They are often referred to as Extended SMTP (ESMTP) commands or SMTP service extensions. Every server can have its own set of extended SMTP commands.
4 0
3 years ago
Which one of these is NOT a type of printer
rusak2 [61]

Answer:

electric

Explanation:

eletric is not a print ouo

4 0
3 years ago
Read 2 more answers
Other questions:
  • In addition to key executives, there are other positions in a company that may be considered critical, or whose loss will be dif
    5·1 answer
  • Which of the following topics is too broad for a 10-minute speech? A. classes offered in interior design B. the history of moder
    13·2 answers
  • Suppose barriers to entry exist in the telecommunications industry. This best describes a _____ market.
    12·1 answer
  • Instructions:Select the correct answer.
    8·2 answers
  • Which port must be open on your router to allow you to upload device configuration and firmware updates using trivial file trans
    13·1 answer
  • An audit trail is a record of how a transaction was handled from input through processing and output
    10·1 answer
  • The right to make others do things is referred to as _________.
    14·2 answers
  • Write a program. Commence the change to be dispensed from a vending machine. An item machine can cost between $0.25 send a dolla
    9·1 answer
  • In which of the following situations would it be most appropriate to choose lossy compression over lossless compression?
    5·1 answer
  • Which program assesses and measures improper medicare fee-for-service payments (based on reviewing selected claims and associate
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!