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
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
English,
4 months ago
Science,
4 months ago
Social Sciences,
4 months ago
Physics,
9 months ago
Biology,
1 year ago