John Lee
2
Q:

Java Program to find the perimeter of the circle

Scanner sc = new Scanner(System.in);
System.out.println("Enter Width of the rectangle: ");
double width = sc.nextDouble();
System.out.println("Enter Height of the rectangle: ");
double height = sc.nextDouble();
sc.close();
// Logic for finding the perimeter of the rectangle
double perimeter = 2 * (width + height);
System.out.println("Perimeter of Rectangle: " + perimeter);
0
@Test
	public void findPerimeterOfTheCircleProgram12() {
		Scanner scanner = new Scanner(System.in);
		System.out.println("Enter the RADIUS of the Circle: ");
		double radius = scanner.nextDouble();
		scanner.close();
		// Logic for printing the PERIMETER of the circle
		System.out.println("Perimeter of the Circle having radius " + radius + (2 * Math.PI * radius));
	}
0

New to Communities?

Join the community