examples of math class in java
siddhartharao77:
Please..dont disturb others @harsimransinghsandhu
Answers
Answered by
1
Syntax: public static datatype abs(datatype arg) Parameters: arg - the argument whose absolute value we need Returns: absolute value of the passed argument. acos() :java.math.acos() method returns the arc cosine value of the passed argument. arc cosine is inverse cosine of the argument passed.
HOPE IT HELPS....
PLEASE PLEASE MARK AS BRAINLIEST
HOPE IT HELPS....
PLEASE PLEASE MARK AS BRAINLIEST
Answered by
1
Math class in Java:
= > Basic numeric operations can be performed with math class.
Ex: abs(), round(), ceil(), floor(), min(), max().
Example (1):
class brainly
{
public static void main(String args[])
{
int a = -10;
int b = 15;
System.out.println(Math.abs(a));
System.out.println(Math.abs(b));
}
}
Example 2:
class brainly
{
public static void main(String args[])
{
int a = 10,
int b = 20;
System.out.println(Math.min(a,b));
}
}
Hope this helps!
Attachments:
Similar questions