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
Choose the type of collection created with each assignment statement
Leviafan [203]

Answer:

dictionary

tuple

list

Explanation:

4 0
3 years ago
How is the “conflict set” defined in Production systems?How conflict is resolved ?
Triss [41]

Answer:

The rules which could trigger at any period in time are referred to as the conflict set. A programming bug/conflict can occur when two programs compete for the same resource such as memory or register etc.

A Conflict Resolution Strategy is is a protocol which highlights which decision will be triggered first.

The best way to resolve conflict is to first determine the kind of conflict it is. Hardware conflicts can be resolved by first troubleshooting the hardware and in some instances unplugging the hardware causing the conflict.

When hardware creates conflicts it may be due to a driver issue. reverting to an old driver or updating the existing one may solve the problem.

Software conflicts can be resolved by installing updates or complete uninstallation.

Cheers!

5 0
3 years ago
What is the term for the era created by the digital revolution?
Ahat [919]
Technological innovation
8 0
3 years ago
During working hours an electrician should not wear
Arlecino [84]
B. a wristwatch or rng because you and get electrocuted 
3 0
3 years ago
Kathy is a senior teacher in her school. She is conducting a group discussion between parents and teachers. Her role is to ensur
Fynjy0 [20]
She is the leader of the discussion
3 0
3 years ago
Read 2 more answers
Other questions:
  • In today's society, unethical actions are: A) Easier than ever to get away with, because the general public and insurers are les
    13·2 answers
  • When a dynamic array with a class for a base type is declared, which constructor is called?
    5·1 answer
  • Consider the following C code fragment:
    10·1 answer
  • As in algebra, you can use brackets to override the order of operations Excel follows to perform formula calculations. True or f
    13·1 answer
  • Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print o
    6·1 answer
  • Assume a TCP sender is continuously sending 1,090-byte segments. If a TCP receiver advertises a window size of 5,718 bytes, and
    7·1 answer
  • Impact of information technology in the society​
    11·1 answer
  • Specifications that establish the compatibility of products and the ability to communicate in a network are called:
    10·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • Write a python program to check whether the number is divisible by 7. If its divisible, print its divisible otherwise find previ
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!