kawaiikittiesandpupp
kawaiikittiesandpupp kawaiikittiesandpupp
  • 12-05-2022
  • Computers and Technology
contestada

The following code has which kind of error?

total = 0

x = 0

while x < 10:

total = total + x

x = x + 1


A. syntax

B. runtime

C. logic

D. fatal

(it would also be helpful to me to say where the error is but you don't have to)​

Respuesta :

kirabowen15
kirabowen15 kirabowen15
  • 12-05-2022

Answer:

There would be a logic error.

Explanation:

The count for x should have been initialized before addint it to the variable total.

Answer Link

Otras preguntas

how do you solve the equation 3x - 2 = x + 10
A pool player hit a ball with a mass of 0.25kg. The ball travels at a velocity of 15 m/s for 0.75 s until it hits the side of the pool table. What additional i
which expression is equivalent to 5y+2y+6x+2y-x
Using 6400 km as the radius of Earth, calculate how high above Earth’s surface you would have to be in order to weigh 1/16th of your current weight. Show all wo
What types of British laws did American colonists protest the most?
Which of the following best describes a rhetorical device? a technique used in writing or speaking that is intended to persuade a technique that employs fallac
one of the ways to generate word of mouth advertising is
plz answer these questions need help
What was jrotc 100 years ago?
The accumulation of small changes in a gene pool over a relatively short period is called: A: anagenesis B: cladogenesis C: microevolution D: punctuated equilib