Answers for "area of rhombus in java"

1

area of rhombus in java

import java.util.Scanner;
public class AreaOfRhombus
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      System.out.println("Please enter length of diagonal 1: ");
      double diagonal1 = sc.nextDouble();
      System.out.println("Please enter length of diagonal 2: ");
      double diagonal2 = sc.nextDouble();
      double area = (diagonal1 * diagonal2) / 2;
      System.out.println("Area of Rhombus is: " + area);
      sc.close();
   }
}
Posted by: Guest on October-30-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language