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
Vsevolod [243]
3 years ago
10

EX 6.1 How many iterations will the following for loops execute? for (int i = 0; i < 20; i+ +) { } for (int i = 1; i <= 20

; i+ +) { } for (int i = 5; i < 20; i+ +) { } for (int i = 20; i > 0; i- -) { } for (int i = 1; i < 20; i = i + 2) { } for (int i = 1; i < 20; i *= 2) { }
Mathematics
1 answer:
Romashka-Z-Leto [24]3 years ago
6 0

Answer:

20, 20, 15, 20, 10, and 5 iterations respectively

Step-by-step explanation:

The loop "for (int i = 0; i < 20; i+ +)" starts at i=0 and increases the counter i by 1 at the end of each iteration. The counter must be less than 20, so the values of i in the loop are 0,1,2,3,...,19. These are 20 values, and thus the code iterated 20 times.

The loop "for (int i = 0; i < 20; i+ +)" starts at i=1 and increases the counter i by 1 at the end of each iteration. The counter can't exceed 20, so the values of i in the loop are 1,2,3,4,...,20. These are 20 values, and thus the code iterated 20 times.

Similarly, in "for (int i = 5; i < 20; i+ +)" i takes the 15 values are 5,6,7,...,19. Hence, the code iterated 15 times.

The loop "for (int i = 20; i > 0; i- -)" starts at i=20 and decreases the counter i by 1 at the end of each iteration, so the values of i in the loop are 20,19,18,...,1. These are 20 values, then we have 20 iterations.

The loop "for (int i = 1; i < 20; i = i + 2)" starts at i=1 and increases the counter i by 2 at the end of each iteration. The values of i in the loop are 1,3,5,7,...,19. These are 10 values, and thus the code iterated 10 times.

The loop "for (int i = 0; i < 20; i+ +)" starts at i=1 and multiplies the counter i by 2 at the end of each iteration, so the values of i in the loop are 1,2,4,8,16. Then we have 5 iterations.

You might be interested in
2^_/2^2=2^3. Please help me I really really really really really need this. THX
Ket [755]
The missing number is 6
5 0
2 years ago
Which of the exponential growth functions has a multiplicative rate of change of 4? 2 f(x) X x f(x) 1 f(x) - 1 NT -1 -1 2 1 4 8
tester [92]
Expondential growth is
7 0
2 years ago
What is this? Please answer with an explanation
Pie

Answer:

5

Step-by-step explanation:

1. in order to calculate all the required values, it needed to solve:

\sqrt{x-5} \geq 0; \  \ x\geq 5.

2. x≥5 means, that x∈[5;+∞), where beginnig is '5'.

3 0
3 years ago
Reflect the shape A in the line x=1<br> What are the coordinates of the vertices of the image?
mestny [16]

Answer:

(0,4) (0,7) (-2,4)

Step-by-step explanation:

The line x=1 is a vertical line that passes through the point (1,0). So we then place the new triangle at equal distance from the line.

I hope this helps!

please mark brainliest!!

6 0
2 years ago
Read 2 more answers
Rome - Test Player
dexar [7]

D is the answer.

Step-by-step explanation:

9 + 6 + 5 = 20

5/20 = 25%

I hope this helps, have a good day!

8 0
3 years ago
Other questions:
  • Tiffany answered 80% of the questions on her math test correctly. There were 40 questions. How many questions did Tiffany get co
    5·1 answer
  • The equation 12x + 15y = 390 represents the total revenue during a one-day fundraiser. In the equation, x represents the number
    6·2 answers
  • For a given input value v, the function f outputs a value u to satisfy the following equation.
    13·1 answer
  • From 65 to 144 find each percent increase round to the nearest percent.
    14·2 answers
  • - x+4=-3x + 8<br> multi-step equations
    9·2 answers
  • What is the algebraic expression for the difference between nine times a number and four more than six times the number?
    9·1 answer
  • 15 POINTS
    11·2 answers
  • ANSWER ASAP IS DUE IN 20 MINUITES (MIDDLE SCHOOL) (PROBABILITY)
    11·2 answers
  • Determine the number of real solutions of -2x^2+ 5x – 3 = 0.<br> 2<br> 1 (double root)<br> 5 <br> 0
    11·1 answer
  • A=1/2f(r+z), solve for r
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!