TheBulgarianWolf

CircleCalculations

Jan 14th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.         System.out.print("Enter circle radius | r = ");
  8.         double radius = Double.parseDouble(scanner.nextLine());
  9.         System.out.println("Area of the circle = " + Math.PI *radius*radius);
  10.         System.out.println("Perimeter of the circle = " + Math.PI*2*radius);
  11.  
  12.     }
  13. }
Add Comment
Please, Sign In to add comment