Computer Science, asked by pritijaiswal96, 9 months ago

Write program to input length and breath of a rectangle. Calculate and print the area and perimeter of a circle. ( Area=length X breadth, Perimeter=2(length X breadth)
In Java script ​

Answers

Answered by priyanshumishramps21
1

Answer:

public class Exercise13 {

public static void main(String[] strings) {

final double width = 5.6;

final double height = 8.5;

double perimeter = 2*(height + width);

double area = width * height;

System.out.printf("Perimeter is 2*(%.1f + %.1f) = %.2f \n", height, width, perimeter);

System.out.printf("Area is %.1f * %.1f = %.2f \n", width, height, area);

}

}

Explanation:

you can edit the programm if u want to take values through user input

Similar questions