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

A triangle has sides with lengths of 65 kilometers, 72 kilometers, and 97 kilometers. Is it a right triangle?
Does the narrator have a baby in The Yellow Wallpaper?
Who benefits from gerrymandering ?
Find the number that makes the ratio equivalent to 1:3.
What is the identity of Cos 2X?
what is the difference between fraternal twins and identical twins in terms of gene reproduction?
assume net income was $100,000, depreciation expense was $8,000, accounts receivable decreased by $7,500, and accounts payable decreased by $2,500. there was al
find the measure of m< ABE
What percent of 20 is 4 step by step?
you own 170 shares of stock in halestorm, incorporated, that currently sells for $82.30 per share. the company has announced a dividend of $3.00 per share with