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
UNO [17]
3 years ago
11

What are the values of i and j after the following code snippet is run? int i = 10; int j = 20; int count = 0; while (count <

5) { i = i + i; i = i + 1; j = j - 1; j = j - j; count++; } System.out.println("i = " + i + ", j = " + j);
Mathematics
1 answer:
AlexFokin [52]3 years ago
6 0

Answer:

i = 351, j = 0

Step-by-step explanation:

The while loop runs 5 times as indicated by the variable, count.

The variable, i, has an initial value of 10. The first line of the loop code doubles the value of i while the second increments it by 1. This is done 5 times. We have

Iteration 1: i = 10 + 10 + 1 = 21

Iteration 1: i = 21 + 21 + 1 = 43

Iteration 1: i = 43 + 43 + 1 = 87

Iteration 1: i = 87 + 87 + 1 = 175

Iteration 1: i = 175 + 175 + 1 = 351

The third line of the loop code decrements j by 1. However, the fourth line sets j = 0 by subtracting it from itself. Hence, j is always 0 at the end of the loop, no matter its initial value or the number of iterations.

Thus, at the end of the code snippet, i = 351 and j = 0.

You might be interested in
If f(x)=x³-2x², which expression equivalent to f(i)?
ICE Princess25 [194]

Answer:

f(x) = x³ - 2x²

=>

f(i) = i³- 2i²

Hope this helps!

:)

7 0
3 years ago
Find the inverse y=3x+2
Gwar [14]

y=3x+2\\\\\text{replace x with y and y with x}\\\\3y+2=x\\\\\text{solve for y}\\\\3y+2=x\ \ \ \ \ |-2\\\\3y=x-2\ \ \ \ \ |:3\\\\\boxed{y=\dfrac{x-2}{3}}

4 0
3 years ago
What did andrew do wrong??
Ivahew [28]
His hand slipped and she could not hold on any longer. He reached out to stop her from falling but all he caught was a single hair. She fell into the abyss and disappeared out of sight. He stared into the emptiness that had stolen his love away from him and began to cry. She was gone. He heard a faint whisper in the background that would haunt him for ever more 'Andrew, what did you do wrong?'

Sorry, I like creative writing.
8 0
3 years ago
Benjamin is selecting embellishments for a child’s dresser. He picks a wooden embellishment, a ceramic embellishment, and a meta
dybincka [34]

Answer:

B

Step-by-step explanation:

Here is the complete question :

Benjamin is selecting embellishments for a child’s dresser. There are 9 wooden embellishments, 5 ceramic embellishments, and 8 metal embellishments to choose from, shown in the table below. He picks a wooden embellishment, a ceramic embellishment, and a metal embellishment. What is the probability that he picks one of the clouds, one of the dogs, and one of the stars?

Wooden Embellishments Ceramic Embellishments Metal Embellishments

2 hearts 2 cats 3 stars

3 clouds 3 dogs 5 squares

4 birds

A.1/27

B. 3/40

C. 1/9

D.3/8

7 0
2 years ago
How do you write 8 million, 6 ten-thousan, 3 hundred ,9ones?
erica [24]

8,610,309 should be it

3 0
3 years ago
Other questions:
  • 39 is 5% of what number
    9·1 answer
  • Please HELP me with 21,22,23 and explain
    7·1 answer
  • What is the lcm of 60
    11·2 answers
  • Jacy wants to buy a phone. She considers the two following plans:
    11·1 answer
  • Write a number that has four digits with the same number in all places, such as 4,444
    13·1 answer
  • Lin rode her bike 2 miles in 8 minutes. She rode at a constant speed. How
    6·1 answer
  • Describe what the graph would look like for the inequality.<br> x &lt; -6 or x &gt;= 4
    9·1 answer
  • A line has a y-intercept of -10 and a slope of 7/4 Find the equation of the line.
    9·1 answer
  • Functions in mathematics can be related to a child who is pounding a drum, the harder the child pound the drum the louder the so
    5·1 answer
  • HELPP FOR BRAAINLISTT
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!