Computer Applications
What is the output of the statement Math.pow(36, 6/5); ?
- 36.0
- 1.0
- 73.71
- 6.0
Java Math Lib Methods
4 Likes
Answer
36.0
Reason — In the expression Math.pow(36, 6/5), the division 6/5 is performed first using integer division, which results in 1 (not 1.2). Therefore, the expression becomes Math.pow(36, 1), which evaluates to 36.0 since the pow() method returns a double value.
Answered By
2 Likes
Related Questions
In a statement
c = c + (x * d + e);which variable is an accumulator?- d
- c
- e
- x
Which of the following is NOT an access specifier?
- private
- protected
- package
- public
Read the if program segment given below:
if(a > b) z = 25; else z = 35;Which one of the following is the correct conversion of the if program segment to ternary?
- z = a > b ? 35 : 25;
- z = a > b ? 25 : 35;
- z = a > b : 35 ? 25;
- z = a > b : 25 ? 35;
The output of the statement:
System.out.println(Character.toUpperCase('b') + 2);is:- 66
- 100
- 68
- 98