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 methods of active transport
two methods of active transport
what are three ways water erodes the surface of earth
what type of rock is the Haystack rock (igneous, Metamorphic, or Sedimentary)
Why did Henry Clay group his resolutions in pairs in the Compromise of 1850?
3 ( 4d + 1 ) - 9d = 6 - 2d
what type of rock is the Haystack rock (igneous, Metamorphic, or Sedimentary)
two methods of active transport
Why did Henry Clay group his resolutions in pairs in the Compromise of 1850?
What's breed of given cat???Check attachment