Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CircleAreaAndPerimeter {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double r = Double.parseDouble(scanner.nextLine());
- double area = Math.PI * r * r;
- double perimeter = 2 * Math.PI * r;
- System.out.printf("%.2f\n%.2f", area, perimeter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement