Mathematical Transformations
A program performs a series of mathematical operations on a double value using static Math methods.
What is printed when the following Java program is compiled and run?
public class QuestionTrace {
public static void main(String[] args) {
double a = Math.abs(-16.0);
double b = Math.sqrt(a);
double c = Math.pow(b, 2);
System.out.println((int) c);
}
}
A
8
B
256
C
16
D
4
Question Leaderboard
Not enough data yet to show leaderboard.
