
- 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
Area of the biggest possible rhombus that can be inscribed in a rectangle in C Program?
Here we will see one problem, where one rectangle is given. We have to find the area of largest rhombus that can be inscribed in the rectangle. The diagram will be look like below −
The length of the rectangle is ‘l’ and breadth is ‘b’ So the area of the rhombus is −
Source Code
#include <iostream> #include <cmath> using namespace std; float area(float l, float b) { if (l < 0 || b < 0) //if the values are negative it is invalid return -1; float area = (l*b) /2; return area; } int main() { float l = 20.0, b = 7; cout << "Area : " << area(l, b); }
Output
Area : 70
- Related Questions & Answers
- Area of the biggest possible rhombus that can be inscribed in a rectangle in C?
- Area of largest triangle that can be inscribed within a rectangle in C Program?
- Area of the largest triangle that can be inscribed within a rectangle?
- Area of Largest rectangle that can be inscribed in an Ellipse?
- Area of circle inscribed within rhombus in C Program?
- Area of circle inscribed within rhombus?
- Biggest Square that can be inscribed within an Equilateral triangle in C?
- Biggest Square that can be inscribed within an Equilateral triangle?
- Area of the Largest square that can be inscribed in an ellipse in C++
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse In C Program?
- Area of a circle inscribed in a rectangle which is inscribed in a semicircle in C?
- Area of a circle inscribed in a rectangle which is inscribed in a semicircle?
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse?
- Maximum area of rectangle possible with given perimeter in C++
- Area of decagon inscribed within the circle in C Program?
Advertisements