Solved

What Is the Output of the Following Code Snippet? Double

Question 6

Multiple Choice

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) r = 16.0
B) r = 128.0
C) r = 4096.0
D) r = 65536.0

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions