How to calculate the circumference of a circle in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
      double r = 6;
      
      double circumference = 2 * Math.PI * r;

      System.out.print(circumference);
    }
}




/*
run:

37.69911184307752

*/

 



answered Nov 30, 2022 by avibootz

Related questions

...