cobi5164 cobi5164
  • 07-02-2024
  • Computers and Technology
contestada

What is the output of the following code snippet
double a = 2;
int n = 16;
double r = 1;
double b = a;
int i = n;
while (i > 0)
{
if (i % 2 == 0) // n is even
{
b = b * b;
i = i / 2;
}
else
{
r = r * b;
i--;
}
}
System.out.println("r = " + r);
a) 16.0
b) 128.0
c) 4096.0
d) 65536.0

Respuesta :

Otras preguntas

Which has more Potential Energy a car parked on the top of the hill,a person on the top of the same hill sitting down eating a sandwich, or a man running fast a
what is 3.36 rounded to the nearest hundreth
What does this quote mean? "Our desire to conform is greater than our respect for objective facts"? And you either defend, challenge, or neutral for the quote.
If the potential energy and the kinetic energy are not the same, where did the leftover energy go?
the water pipe has a radius of 5 cm and a height of 7 cm. what volume of water does it take to fill the pipe?
Are there any personifications in the poem jimmy jet and his TV set?
Round 1.0649 to the nearest thousandth
Are there any personifications in the poem jimmy jet and his TV set?
Which requires the removal of heat, melting or freezing?Is it evaporation? What is it? Why?
which is bigger 20 kilograms or 2,000 grams