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

Needed a little help
Which verb form correctly completes this sentence? Ce weekend nous __________ du camping. A. feront B. ferez C. allons faire D. vont faire
Am I correct??? Thanks
How does the following quote develop the narrator’s point of view?: “I desire those politicians who dislike my overture… that they will first ask the parents of
Solve for x: x6 = 12 Question 2 options: 72 1 0 6
cam thinks about using heroin all day while at work what is the correct stage off addiction cycle
when evaluating idea development in your writing , what is a good question to ask yourself ?
Chris bought 6 packages of napkins for his restaurant there were 200 napkins in each package how many napkins did Chris Buy
PLEASE ANSWER!!!Which type of investment would be an example of an investment at point B?a US savings bonda CDa stocka savings account
Do you think that John Muir made an affective argument for saving the redwoods? Why or why not?