A rhombus is a quadrilateral whose four sides all have the same length and 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
Input : p = 2, q = 3 Output: 3 Input : p = 4, q = 5 Output: 10
Area of rhombus = 3.0
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.