Java – Math PI Example, Math PI Program

Math class is part of java.lang package. Math PI returns the pi value of 3.141592653589793

Math PI example how to use Math PI in java

public class MathPIExample {

    public static void main(String[] args) {

        double E=Math.PI;

        System.out.println("Math PI :"+E);
    }
}

Output

Math PI :3.141592653589793

Tags:

Bookmark  

 

Leave a Reply

Security Code:

 

  Random Post