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]
4 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]4 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
a carpenter has a wooden stick that is 84 centimeters long. She cuts off 25% from the end of the stick. then she cuts the remain
Karo-lina-s [1.5K]
She cuts off 21 cm. this leaves 63cm. cut into 6 equal pieces gives 10.5 cm pcs
3 0
3 years ago
The force which pulls or tends to pull a body is called____​
Setler [38]

Answer:

force of gravity

hope it helps

pls mark me as the brainliest

thank u

8 0
3 years ago
Read 2 more answers
what is the slope of the line that passes through the points (7,-6) and (4,-6)? write your answer in simplest form
Andrews [41]

Answer:

<u>m = 0</u>, y = -6

Step-by-step explanation:

using point slope form :

y - y_{1} = m(x - x_{1})

y-y1=m(x-x1) ; initial point (x1,y1) = (4,-6), final point (x,y) = (7,-6).

one substituted, it should look like this:

-6--6 = m(7-4),

-6+6= m(7-4)

0 = m(7-4)

0 = 3m

0/3 = 3/3m

0 = m

m = 0/3 = 0

4 0
3 years ago
Instructions: Find the measure of the indicated angle to the nearest
SVETLANKA909090 [29]

To find the indicated angle, we can use one of the three main trigonometric functions: sine, cosine, or tangent.

Remember: SOH-CAH-TOA

Looking from the angle, we know the adjacent side and the hypotenuse. Therefore, we should use cosine to solve.

cos(x) = 12/36

x = cos^-1(12/36)

x = 71 degrees

Hope this helps!

6 0
3 years ago
What is the area of the triangle?
EleoNora [17]
I say A=b*h 
=312 hope this helps

3 0
3 years ago
Other questions:
  • 5^2+x^2=10^2<br><br> What Is X and how do you find the angles for it?
    7·1 answer
  • 4(4x+3)=19x+9-3x+3 what are the steps
    6·1 answer
  • Is the answer to this D???? U are finding the midpoint again...
    12·1 answer
  • A line goes through the points (-6, -8) and (12, 7). a) What is the slope of the line? Show your work. b) Write the equation of
    9·1 answer
  • Please help it is 6th grade math easy for you guys
    11·1 answer
  • Is 0.004 greater than 0.00400?
    10·1 answer
  • Write the point -slope form of the equation of each line given the slope and y-intercept. Slope=(2/3), y-intercept =0
    7·1 answer
  • John wants to join a gym so that he can work out during the evenings. There are two gyms in his town that he is considering. Ext
    8·2 answers
  • PLEASE HELP!!
    12·1 answer
  • What is 65% of 20?<br><br><br><br><br><br> ye
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!