Using the Math Class

AP Computer Science A· difficulty 3/5

double p = Math.pow(2, 5);
System.out.println(p);

What is printed?

  • A

    25.0

  • B

    10.0

  • C

    32.0

    check_circle
  • D

    32

Explanation

Math.pow(2, 5) computes 2^5 = 32 and returns a double, so 32.0 is printed.

Want 10 more like this — adaptive to your weak spots?

Related questions