C Program To Calculate Area of Rhombus

preview_player
Показать описание

Lets write a C program to calculate area of a Rhombus using its side and a diagonal. We ask the user to input the value of side and a diagonal.

A Rhombus is a polygon having 4 equal sides in which both the opposite sides are parallel and opposite angles are equal.

q = sqrt( (4 x side x side) – (p x p) );
p = sqrt( (4 x side x side) – (q x q) );

area = (p x q) / 2.0;
OR
area = (p x q) x 0.5;

where p and q are diagonals of the Rhombus.

C Programming Interview / Viva Q&A List

C Programming: Beginner To Advance To Expert
Рекомендации по теме