Math, asked by brundha376, 5 months ago

State the value and datatype of the answer for the following:

a. Math.abs(-5)-Math.abs(-7)

b. Math.max(1.5e-2,0.095)

c. Math.round(1.49+1)

d. Math.round(1.49)+1

e. Math.floor(5.6)

f. Math.ceil(4.1)

g. Math.min(3.4,1)

please answer all the questions ​

Answers

Answered by mad210203
10

Answers:

a. -2

b. 0.095

c. 2

d. 2

e. 5

f. 5

g. 1

Explanation:

a. Math.abs(-5)-Math.abs(-7)

  • abs returns the absolute value of the given number or argument.
  • The data type can be int, float, long, double.
  • The value of Math.abs(-5) is 5.
  • The value of Math.abs(-7) is 7.
  • So, the value of Math.abs(-5)-Math.abs(-7) = 5 - 7 = -2.

b. Math.max(1.5e-2,0.095)

  • max returns the largest numbers of the two arguments .
  • The data type can be int, float, long, double.
  • The largest of 1.5e-2 and 0.095 is
  • So, the value of Math.max(1.5e-2,0.095) is 0.095.

c. Math.round(1.49+1)

  • round returns the nearby int or long (as per the argument).
  • Basically, it it used to round off the number.
  • The datatype can be double or float.
  • 1.49+1=2.49.
  • The nearby value to 2.49 is 2.
  • So, the value of Math.round(1.49+1) is 2.

d. Math.round(1.49)+1

  • round returns the nearby int or long (as per the argument).
  • Basically, it it used to round off the number.
  • The datatype can be double or float.
  • The nearby value to 1.49 is 1.
  • So, the value of Math.round(1.49) is 1.
  • Now, Math.round(1.49)+1 =1+1=2.

e. Math.floor(5.6)

  • floor returns the largest integer which is less than or equal to the given argument.
  • The datatype can be double.
  • So, the value of Math.floor(5.6) is 5.0.

f. Math.ceil(4.1)

  • ceil returns the smallest integer which is greater than or equal to the given argument.
  • The datatype can be double.
  • So, the value of Math.ceil(4.1) is 5.0.

g. Math.min(3.4,1)

  • min returns the smallest numbers of the two given arguments.
  • The datatype can be int, float, long, double.
  • So, the value of Math.min(3.4,1) is 1.
Answered by anbukannan2010
3

Answer:

nakku setha payale loosu

Similar questions