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

Round 87,298 to the nearest thousand
Why is it difficult to see colors outside at night? Question 3 options: Our eyes have rods and cones inside. The rods help us see color, but they need more lig
Why type of hat does abu from aladdin wear?
what are the differences between a allen wrench and a screwdriver
Does anybody have any tips on how to remember what the story was about in the books u read for english? Thnx.
Which number line shows the given inequality? m < 7.5
The visual cliff is a laboratory device for testing ________ in infants.
There are 342 g of sucrose in 1.00 mol of sucrose. What is the molar concentration (molarity) of a solution containing 171 g sucrose in 0.750 L solution?
How did this map change following the Treaty of Washington in 1846?
Plz help question below