What will be output of the following math functions:-
• Math.max (-17, -19)
• Math.max (15,17)
• Math.min (12, 13)
• Math.min (19, 13)
Answers
Answered by
158
Question given:
- What will be output of the following math functions:-
- • Math.max (-17, -19)
- • Math.max (15,17)
- • Math.min (12, 13)
- • 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 (-17 , -19)
- Here the largest integer is -17.
• Math.max (15 , 17)
- Here the largest integer is 17.
• Math.min (12, 13)
- Math.min returns smallest integer so here the smallest integer is 12.
• Math.min (19, 13)
- Math.min (19, 13)Math.min returns smallest integer so here the smallest integer is 13.
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