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]
3 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]3 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
How i can download play store?​
Phantasy [73]

Answer:

in Google type play Store and you will get the app and then click on that word install and it will get installed

Explanation:

hope this helps

3 0
3 years ago
If you want to prioritize downloads of your mobile app instead of visits to your mobile site, you should: a) add a sitelink exte
scoray [572]

Answer:

create a Universal App campaign

3 0
2 years ago
To make a complicated task easier, use a _____.
tia_tia [17]
I believe the answer is B spread sheet because i use spread sheets to make my life easier. I organize info in a spread sheet then it is really easy to find.

hope this helps<span />
6 0
2 years ago
Suppose that the bag class is efficiently implemented with a fixed array with a capacity of 4000, as in Chapter 3 of the class t
Phoenix [80]

Answer:

b.used is 2, b.data[0] is 4, b.data[1] is 6

Explanation:

bag b;

b.insert(5); // b has 5

b.insert(4); // b has 5,4

b.insert(6); // b has 5,4,6

b.erase_one(5); // now 5 is removed , b has 4,6

so no:of elements b.used is 2

b[0]=4;

b[1]=6;

6 0
3 years ago
Which type of cell references are locked and NOT automatically updated when it’s copied
dsp73

Hi I would have to say B sorry if this answer is sucky but I'm trying my best to help you :D

4 0
2 years ago
Other questions:
  • Why was the term personal computer created?
    5·1 answer
  • We want to construct a memory with 256 bytes in capacity. Assume that each byte has a unique address. (a) How many address lines
    14·1 answer
  • What is the correct process for inserting a blank worksheet in Google sheets
    12·1 answer
  • When programming in Scratch, to make our Sprite walk across the background, in which category would we find the programming bloc
    7·1 answer
  • Which of the following instruments are used when performing a high-rate discharge test on a storage battery
    7·1 answer
  • Differentiated instruction is designed to educate children through ________ techniques in order to ensure every student is being
    13·1 answer
  • What aspects of your life are most influenced by media and technology​
    14·1 answer
  • Role of memory in a computer system
    10·1 answer
  • What are the four steps for planning a table?​
    10·1 answer
  • Any changes done to the software during the operational phase of the software before project wind up is called as maintenance. S
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!