Computer Science, asked by brainbooster29, 1 month ago

(d) What is the final value stored in variable ?
double a =-8.35;
double x = Math.abs(Math.floor(a));
1. 9.0
2.
7.0
3. 6
4. 7​

Answers

Answered by muskanjainbrt
40

Answer:

9.0

Explanation:

as math.abs will return the value by making that + and math.floor will return the value 9 and as we have to return the value in double(data type )so it will be 9.0

Answered by adventureisland
10

Answer:

1) 9.0

Program:

{

   double a =-8.35;

  double x = Math. Abs(Math. Floor(a));

  print(x);

   }

Output is 9.0

Explanation:  

  • Math. Abs()  returns an int value's absolute value. The argument is returned if the argument is not negative. The negation of the argument is returned if the argument is negative. If the argument is equal to the value of Integer.
  • Math. Floor() method returns the smallest or equal integer that is smaller or equal to the specified value. The placeholder object Math must be used since the floor function is a static method under Math. It goes without saying that arguments can only be integers or floating numbers.
Similar questions