Answers for "Write a java program to input the length and the width of a rectangle and calculate and print the perimeter."

0

java program to find perimeter of rectangle

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);
Posted by: Guest on November-11-2020

Code answers related to "Write a java program to input the length and the width of a rectangle and calculate and print the perimeter."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language