Kizmit903 Kizmit903
  • 13-08-2020
  • Computers and Technology
contestada

Give a tight bound on the number of times the z = z + 1 statement is executed. i = 2 while ( i > 1 ) { i = floor(i/2) z = z + 1 }

Respuesta :

IfeanyiEze8899 IfeanyiEze8899
  • 17-08-2020

Answer:

zero ( 0) times.

Explanation:

In the code;

i = 2

while ( i > 2){

     i = floor( i/2 );

     z = z + 1;

}

the variable " i " is assigned the integer " 2 ", then the while statement loops with a condition of a greater " i " value and divides the value by two for every loop.

But in this case, the while statement is not executed as the value of " i " which is 2 is not greater than but equal to two.

Answer Link

Otras preguntas

what is 3/4 of 16/21
What does ¿Cuál es la fecha del Día de San Patricio? mean and how would you reply?
14/20 minus 3/5 equals
Solving Trig. Equations:csc^2x-2cot^2x=0
Montel sold 13 popcorn buckets and 13 fruit baskets for a fundraiser. The fruit baskets cost $20.75 each. If Montel raised a total of $468.00, how much did each
The Rogers family drove a total of 482 miles, starting on Friday and ending on Sunday. They drove 138 miles on Friday and 225 miles on Saturday. How many miles
574 is 70% of what number?
"We are made of stardust" refers to a. the dust of dead skin cells we shed every day. b. the rotating cloud of stardust that formed the planets. c. the gases in
evaluate the function f(x)=7x+3 at the given values of the independent variable and simplifya. f(5) b. f(x+8) c. f(-x)HELP
1. Analysis reveals that _______ is among those countries with the lowest per capita GDP.A. MexicoB. ArgentinaC. RomaniaD. India 2. Juan Perón was to Argentina