// Example of using the constant PI
//Uses c = 2 * pi * r to find circumference of a circle
import java.io.*;
class UsePI {
public static void main (String [] args) {
double storePI = Math.PI; // Pi is just a number
double radius = 1.2;
double circumference;
circumference = 2 * storePI * radius * radius;
System.out.println("The value of PI is " + storePI);
System.out.print("The circle with radius " + radius);
System.out.println("has circumference " + circumference);
} // end main
} // end UsePI |