What will be output of the following math functions:-
• Math.max (22, 12)
• Math.max (18,24)
• Math.min (14, 18)
• Math.min (19, 13)
Answers
Answered by
1
Explanation:
Math.max (22, 12) = 22
Math.max (18, 24) = 24
Math.min (14, 18) = 14
Math.min (19, 13) = 13
Answered by
207
Question given:
- What will be output of the following math functions:-
- Math.max (22, 12)
- Math.max (18,24)
- Math.min (14, 18)
- Math.min (19, 13)
What does we have to do:
- We have to calculate and give the output of the given math functions.
Basic understanding:
- As we know that max method returns us the largest integer of the given two arguments.
- We also know that min method returns us the smallest integer of the given two arguments.
Syntax:-
- max : Math.max (a , b)
- min : Math.min (a , b)
Forming answer:
Math.max (22, 12)
- Here the largest integer would be returned.
Math.max (18,24)
- Here largest integer would be returned to us. So on comparing we gets 24 as the largest integer.
Math.min (14, 18)
- Smallest integer would be returned to us. On comparing we gets 14.
Math.min (19, 13)
- Smallest integer would be returned to us. On comparing we gets 13 as the smallest number.
Additional information:
- Method is a named block of a códe in a class. It is executed within a defined set of instructions.
- Methods and variables of math class are defined as static members.
- Java.lang package contains classes and interfaces which are fundamental to Java programming language.
- The math class of java.lang package contains generic mathematical functions including some geometric and trigonometric function.
- Math.cbrt returns cube root of a double value.
- Math.ceil returns smallest integer which is greater or equal to the argument.
- Math.abs returns us the absolute value of a given argument.
- Math.pow it returns us the value of a first given argument raised to the power of the given second argument.
More similar questions:
- https://brainly.in/question/42140095?utm_source=android&utm_medium=share&utm_campaign=question
- https://brainly.in/question/30816677?utm_source=android&utm_medium=share&utm_campaign=question
- https://brainly.in/question/18010374?utm_source=android&utm_medium=share&utm_campaign=question
- https://brainly.in/question/44313763?utm_source=android&utm_medium=share&utm_campaign=question
Similar questions