soccerstar8916 soccerstar8916
  • 18-10-2019
  • Computers and Technology
contestada

The following code snippet will output the value of 44. int a = 0; int total = 0; do { total = total + a; a++; } while (a < 10); System.out.println(total); Select one: True False

Respuesta :

ExieFansler ExieFansler
  • 18-10-2019

Answer:

False.

Explanation:

What the code does is it calculates the sum of integers from 0 to 9 and prints it.

In the code a total variable is declared and initialized with the value 0.Then the do while loop is used to calculate the sum by storing it in the total variable.

This code will print 45 because the sum from 0 to 9 is 45.It will not add 10 because after adding 9 to total the value of a is updates it becomes 10 and it is checked the loop condition fails.

Answer Link

Otras preguntas

1. Hung is ………….. student in my class. A. good B. better C. the best D. a best
Explain "Honouring a labour should be taken as honouring one's life".​
Question You and your friend are selling magazine subscriptions for a fundraiser. After w weeks, you have sold (3w+4) subscriptions and your friend has sold (5w
what do Primary Source mean in the middle ages
Explain the correlation between solar radiation and kelp biomass .
3. Write an equation in slope-intercept form for the line with a slope of 5/4 and a y-intercept of 2.
Which of the following protects the brokers commission
Answer #5 for me and explain your answer ! I'll be giving brainliest to who is right :)​
(PLEASE HELP, BRAINLIEST IF CORRECT)
If the Plane moves at 253km southwest and the wind blows from 60' south east. Calculate the Age of the Pilot.