goldy501 goldy501
  • 01-02-2021
  • Computers and Technology
contestada

What is the value of numC at the end of this loop?

numC = 12

while numC > 3:

numC = numC / 2


numC =

Respuesta :

fichoh
fichoh fichoh
  • 02-02-2021

Answer: 3

Explanation:

What is the value of numC at the end of this loop?

numC = 12

while numC > 3:

numC = numC / 2

numC =

The initial numC value = 12

Condition : while numC is greater than 3 ; 12 > 3 (condition met)

The expression numC / 2 is evaluated

numC / 2 = 12 / 2 = 6

numC then becomes 6 ;

Condition : while numC is greater than 3 ; 6 > 3 (condition met)

numC / 2 = 6 /2 = 3

numC = 3

Condition : while numC is greater than 3 ; 3 > 3 (condition not met)

Loop terminates

numC = 3

Answer Link

Otras preguntas

What are the 3 features of a typical seigneurie
A farmer hauled in 120 bales of hay. Each of his cows ate 1 1/4 bales. How many cows the farmer feed?
What is biogeography and what does it provide?
which factor made the most difference in how agriculture affected the economies of the colonies?
Which of the following statements is true concerning LUCA? (1) LUCA was a cell. (2) All life on Earth evolved from LUCA. (3) LUCA probably existed probably arou
Which of the following organisms can perform alcoholic fermentation? (1) yeast, (2) humans, (3) bacteria. a. 1 and 2 b. 1 and 3 c. 1 only d. 1, 2, and 3
The length of a diagonal of a cube with edge length 25cm
Explain how a species can evolve through natural selection.
By the mid-1700s, the largest city in the colonies was (A) New York (B) Boston (C) Philadelphia (D) Charleston (E) Wilmington, Delaware
which state of matter has the least amount of energy?