170k views
1 vote
What is the value of x after each of the following java statements:

1. x = math.pow(4,2);
2. x = math.exp(3);
3. x = math.sqrt(16);
4. x = math.abs(-123);
5. x = math.ceil(7.2);
6. x = math.floor(6.7);
7. x math.rint(5.8);
8. x= math.max(3.4, 3.9);

User Rebeka
by
8.3k points

1 Answer

4 votes

Final answer:

The value of x after each of the given Java statements is provided with explanations.

Step-by-step explanation:

The value of x after each of the following Java statements is:

  1. x = math.pow(4,2); → x = 16
  2. x = math.exp(3); → x ≈ 20.0855
  3. x = math.sqrt(16); → x = 4
  4. x = math.abs(-123); → x = 123
  5. x = math.ceil(7.2); → x = 8
  6. x = math.floor(6.7); → x = 6
  7. x = math.rint(5.8); → x = 6
  8. x = math.max(3.4, 3.9); → x = 3.9

User Towr
by
8.0k points