logo image

Java program to find Area, Perimeter of a Parallelogram

Parallelogram is a quadrilateral with two pairs of parallel sides. Following image shows you how a Parallelogram looks like


Following is the Java program that takes Length, Breadth and height as inputs and compute Area, Perimeter of a Parallelogram

import java.util.Scanner;

public class AreaAndPerimeterOfParallelogram {
	public static void main(String[] args) {

		// Taking inputs from user
		Scanner sc = new Scanner(System.in);

		System.out.print("Enter the Length: ");
		double length = sc.nextDouble();

		System.out.print("Enter the Breadth: ");
		double breadth = sc.nextDouble();
		System.out.print("Enter the Height: ");
		double height = sc.nextDouble();


		double area = length * height;
		double perimeter = 2 * (length + breadth);
		System.out.println("Area: " + area);
		System.out.println("Perimeter: " + perimeter);


Enter the Length: 10
Enter the Breadth: 8
Enter the Height: 7
Area: 70.0
Perimeter: 36.0