
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Program to find the perimeter of a rhombus using diagonals
Rhombus is a simple quadrilateral whose four sides all have the same length. And perimeter of rhombus can be found by two methods.
- Adding all side.
- Using the diagonals
A quadrilateral has two diagonal and based on the length of diagonals the area and perimeter of the quadrilateral can be found.
To find the perimeter of a rhombus using its diagonals is 2{√(d1)2 + (d2)2 }
LOGIC − To find the perimeter of a rhombus using its diagonals. You need the formula 2{√(d1)2 + (d2)2 } for this in your code you need to use the math class that supports the use of squareRoot and square of the number.
The Below code display Program to find the perimeter of rhombus using its diagonals.
Example
#include <stdio.h> #include <math.h> int main(){ int d1 = 3, d2= 4, perimeter; perimeter = (2 * sqrt(pow(d1,2)+pow(d2,2))); printf("perimeter is %d", perimeter); return 0; }
Output
perimeter is 10
- Related Questions & Answers
- Program to calculate area and perimeter of a rhombus whose diagonals are given What is rhombus in C++?
- Java Program to find the perimeter of a cylinder
- Java Program to Find the Perimeter of a Rectangle
- Java Program to Find the Perimeter of a Circle
- Python Program for Find the perimeter of a cylinder
- Find the perimeter of a cylinder in Python Program
- Program to find largest perimeter triangle using Python
- Program to find perimeter of a polygon in Python
- Program to find the Area and Perimeter of a Semicircle in C++
- Java Program to Compute the Sum of Diagonals of a Matrix
- Java Program to Interchange the Diagonals
- Find the perimeter of a cylinder in C++
- Program to find the perimeter of an island shape in Python
- Program to Calculate the Perimeter of a Decagon in C program
- Find Perimeter of a triangle in C++
Advertisements