
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Area of largest triangle that can be inscribed within a rectangle in C Program?
Suppose one rectangle is given. We know the length L and breadth B of it. We have to find the area of largest triangle that can be inscribed within that rectangle −
The largest triangle will always be the half of the rectangle. So it will be
Example
#include <iostream> #include <cmath> using namespace std; float area(float l, float b) { if (l < 0 || b < 0 ) //if the valuse are negative it is invalid return -1; float area = (l*b)/2; return area; } int main() { float a = 10, b = 8; cout << "Area : " << area(a, b); }
Output
Area : 40
- Related Articles
- 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 the biggest possible rhombus that can be inscribed in a rectangle in C Program?
- Biggest Square that can be inscribed within an Equilateral triangle in C?
- Area of the biggest possible rhombus that can be inscribed in a rectangle 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 the Largest Triangle inscribed in a Hexagon in C++
- C++ program to find the Area of the Largest Triangle inscribed in a Hexagon?
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse?
- Area of circle inscribed within rhombus in C Program?
- Find the area of the largest triangle that can be inscribed in a semi-circle of radius $r$ units, in square units.
- Area of decagon inscribed within the circle in C Program?
- C Program for area of decagon inscribed within the circle?

Advertisements