

- 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 a triangle inside a parallelogram in C++
The area of a figure is the extent of the figure in two-dimensional plane.
Triangle is a polygon with three sides.
Parallelogram is a quadrilateral with opposite sides equal and parallel.
In this program, we have a parallelogram with its base and height and it inscribed a triangle the same base as the parallelogram. We need to calculate the area of the triangle using the given base and height.
Area of triangle constructed take the base of a parallelogram and common height as the parallelogram is given by the formula = 0.5 * base * height
area = ½ * b * h
Example
#include<iostream> #include<math.h> using namespace std; int main(){ float b, h, Area; b = 30.0; h = 22.0; Area = (0.5 * b * h); cout<<"Area of triangle with base "<<b<<" and height "<<h<<" is "<<Area; return 0; }
Output
Area of triangle with base 30 and height 22 is 330
- Related Questions & Answers
- Java Program to Find the Area of a Parallelogram
- Program to find the Area of a Parallelogram in C++
- Area of a leaf inside a square?
- Area of Circumcircle of a Right Angled Triangle?
- Area of Reuleaux Triangle?
- Area of a leaf inside a square in C Program?
- C++ Perimeter and Area of Varignon’s Parallelogram
- Java program to find the area of a triangle
- Area of Incircle of a Right Angled Triangle in C Program?
- Area of Circumcircle of a Right Angled Triangle in C Program?
- Check whether a given point lies inside a Triangle
- Area of the Largest Triangle inscribed in a Hexagon in C++
- How to Calculate the Area of a Triangle using Python?
- Largest Triangle Area in Python
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse?
Advertisements