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

Two marbles, one twice as massive as theother, are dropped from the same height.When they strike the ground, how does thekinetic energy of the more massive marb
22 What will NOT pollute the groundwater? F Motor oil spillage G Compost production H Injected radioactive waste J Lawn fertilizers
What were some positive effects of the war on the US economy?
MCHS sold 150 tickets at the last basketball game. Student tickets cost $3 and adult tickets cost $5. If they sold $580 worth of tickets, how many of each type
How much did Francis earn per hour?
What is the slope of the line that passes through the points (4, 4)(4,4) and (10, 7) ?(10,7)? Write your answer in simplest form.
Tetra fish that live in caves are blind and have small eyes that do not work. This is an example of a __________.
Who comes up with the laws
Tell whether 3(x - 3) + 3 =2x - 4 has one,zero or infinitely soulutions
In the last chapter, we looked at three outliers arising from a plot of Average Wind Speed by Month in the Hopkins Forest. Each was associated with an unusually