🔒 Closed Math class baka may nakakaalam po

Status
Not open for further replies.

Kaakak

Honorary Poster
Baka may nakakaalam po mga boss salamat sa tutulong
Java.webp
 
class name - Math_Operation
fileName - Math_Operation.java


Java:
import java.lang.Math;

class Math_Operation
{
    public static void main(String[] args)
    {
        // floor() returns he largest (closest to positive infinity)
        // double value that is less than or equal to the argument and
        // is equal to a mathematical integer
        System.out.println("Math.floor(10) = "+Math.floor(10));
        System.out.println("Math.floor(7) = "+Math.floor(7));

        //ceil() Returns the smallest (closest to negative infinity)
        // double value that is greater than or equal to the argument
        // and is equal to a mathematical integer
        System.out.println("Math.ceil(6.251) = "+Math.ceil(6.251));

        //min() Returns the smaller of two int values
        System.out.println("Math.min(17,41) = "+Math.min(17, 41));

        //pow() Returns the value of the first argument raised to the power of the second argument
        System.out.println("Math.pow(6,2) = "+Math.pow(6, 2));

        //abs() Returns the absolute value of an int value
        System.out.println("Math.abs(-53) = "+Math.abs(-53));

        //round() Returns the closest long to the argument
        System.out.println("Math.round(21.47) = "+Math.round(21.47));
    }
}

Code:
1642482385987.webp


Output:
1642482410642.webp
 
class name - Math_Operation
fileName - Math_Operation.java


Java:
import java.lang.Math;

class Math_Operation
{
    public static void main(String[] args)
    {
        // floor() returns he largest (closest to positive infinity)
        // double value that is less than or equal to the argument and
        // is equal to a mathematical integer
        System.out.println("Math.floor(10) = "+Math.floor(10));
        System.out.println("Math.floor(7) = "+Math.floor(7));

        //ceil() Returns the smallest (closest to negative infinity)
        // double value that is greater than or equal to the argument
        // and is equal to a mathematical integer
        System.out.println("Math.ceil(6.251) = "+Math.ceil(6.251));

        //min() Returns the smaller of two int values
        System.out.println("Math.min(17,41) = "+Math.min(17, 41));

        //pow() Returns the value of the first argument raised to the power of the second argument
        System.out.println("Math.pow(6,2) = "+Math.pow(6, 2));

        //abs() Returns the absolute value of an int value
        System.out.println("Math.abs(-53) = "+Math.abs(-53));

        //round() Returns the closest long to the argument
        System.out.println("Math.round(21.47) = "+Math.round(21.47));
    }
}

Code:
View attachment 1789905

Output:
View attachment 1789906
maraming salamat lods
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 1K
    Views
  • 2
    Participants
Last reply from:
jaeope

Online now

Members online
992
Guests online
1,054
Total visitors
2,046

Forum statistics

Threads
2,276,161
Posts
28,967,972
Members
1,231,145
Latest member
kennethCASTRO2012
Back
Top