Computer Science, asked by MoParvej, 1 year ago

examples of math class in java


siddhartharao77: Please..dont disturb others @harsimransinghsandhu

Answers

Answered by PriyankaTiwari1407
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

MoParvej: who r u pls
MoParvej: tell
MoParvej: sorry
MoParvej: i was just talking to my frnd ayush
MoParvej: he is online but bot replying anything ok
MoParvej: than pls don't reply
MoParvej: ok bye bro
Answered by siddhartharao77
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:

MoParvej: thanks bro
siddhartharao77: Welcome!
duragpalsingh: Bro? First letter of class is upper case?
siddhartharao77: Not mandatory bro.. if u give edit option, i will show the output also
siddhartharao77: Done bro!
duragpalsingh: But it happens with me. :(
siddhartharao77: ohh.. Most editors/compilers will support class names in small letters. But you should write the class name in capital letters only. :-)
duragpalsingh: BlueJ don't support right?
siddhartharao77: dont know bro.. i use different editors.
Similar questions