Program to Find Perimeter of Parallelogram

bookmark

import java.util.*;
public class Main
{
   public static void main(String args[]) 
    {   
         //Object of Scanner class is created
         Scanner sc= new Scanner(System.in);
         //breadth declared
         double breadth= 2.9;
         //length declared
         double length= 5.9;
         //Finding the perimeter using the formula
         double  perimeter=2*(length+breadth);
         System.out.println("Perimeter of Parallelogram : " + perimeter); 
    }
}


Output:

Perimeter of Parallelogram : 17.6