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

use the trapezoidal rule, the midpoint rule, and simpson's rule to approximate the given integral with the specified value of n. (round your answers to six deci
As the human population increases, stressors are being placed on the environment. Which of the following is one consequence of this growth? increases in availa
The scatter diagram shows the scores of 10 students in their paper 1 and paper 2 Maths GCSE exams.
Line ℓ has equation y= –x–3. Find the distance between ℓ and the point I(2,5).
What conclusions can you draw from lines 1-18 from the Canterbury Tales about what people might choose this season to go on pilgrimage? a. St. Thomas Becket's
how do you solve i? 9 = i +7 show your work
how do you solve this?
6x + 5x + 2y 11x + 2y 13xy : please explain please please ​
is cube root of 72 an irrational number? what about 1+ square root of 3?
HELP PLEASE Exercise 5. Complete the text with on, in, by or at. Last year 1 …… Easter I went to England for a short holiday. I arrived in London 2 …… Friday 3