VOOZH about

URL: https://www.geeksforgeeks.org/java/java-program-to-find-the-area-of-rhombus/

⇱ Java Program to Find the Area of Rhombus - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Java Program to Find the Area of Rhombus

Last Updated : 3 Aug, 2022

A rhombus is a quadrilateral whose four sides all have the same length and a rhombus is also called an equilateral quadrilateral.

The formula for finding the area of a rhombus is as follows:

(product of the lengths of the diagonals)/2 

Example:

Input : p = 2, q = 3
Output: 3
Input : p = 4, q = 5
Output: 10

Implementation:


Output
Area of rhombus = 3.0

Time complexity: O(1) since performing constant operations.

Space complexity: O(1)

Comment
Article Tags:
Article Tags: