Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner; // import Scan method
- public class Circle // Class or file name
- {
- public static void main(String [] args)
- {
- System.out.print("Please, insert your radius");
- Scanner rad = new Scanner (System.in);
- double r = rad.nextDouble(); // create a Double (Integer with floating values) to scan your value
- System.out.println("Area of this circle is "+Math.PI*r*r);
- System.out.println("Circumference of this circle is "+2*Math.PI*r);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement