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

Help me with this question please
what is the cultural significance of Solstice's, such as Yule and Litha?
Mientras estábamos en Madrid, fuimos al de una escultora famosa. tallar lienzo cincel taller
Planes de viaje Completa la postal con la forma adecuada de las palabras del recuadro. visitar salir hacer llegar perder ir Queridos amigos: a Guatavita. Marta
Which of these options for saving money typically offers the most liquidity?
On a​ map, 1 inch equals 5 miles. Two cities are 9 inches apart on the map. What is the actual distance between the​ cities? Question content area bottom Part 1
Explain the similarities and difference between narrative poetry and lyric poetry.
3 years ago, the residents of Planet X found a black hole leading to another galaxy. Since then, they have been leaving Planet X at a rate of 120 residents per
What is the Einstein Rosen Bridge Theory? Is it possible why or why not? (IN YOUR OWN WORDS ANYTHING ELSE WILL BE DELETED)
Policy adoption is a step in which of the following? A. the policy-making process B. the policy cycle C. the policy dance D. the policy process