- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 calculate area and perimeter of equilateral triangle in C++
What is Equilateral Triangle?
As the name suggests, equilateral triangle is the one that have equal sides and also it have equal interior angles of 60° each. It is also known as regular triangle because it’s a regularpolygon
Properties of equilateral triangle are −
- 3 sides of equal length
- Interior angles of same degree which is 60
Given below is the figure of equilateral triangle
Problem
Given with the side of equilateral triangle the task is to find the area and perimeter of a triangle where area is the space occupied by the shape and perimeter is the space occupied by its boundaries.
To calculate area and perimeter of a equilateral triangle there is a formula
Example
Input-: side=14.0 Output-: Area of Equilateral Triangle is : 84.8705 Perimeter of Equilateral Triangle: 42
ALGORITHM
Start Step 1 -> Declare function to calculate area of equilateral trainagle Float area(float side) Return sqrt(3) / 4 * side * side Step 2 -> Declare function to calculate perimeter of equilateral trainagle Float perimeter(float side) Return 3 * side Step 3 -> In main() float side = 14.0 call area(side) call perimeter(side) Stop
CODE
#include <bits/stdc++.h> using namespace std; //function to calculate area of equilateral triangle float area(float side){ return sqrt(3) / 4 * side * side; } //function to calculate perimeter of equilateral triangle float perimeter(float side){ return 3 * side; } int main(){ float side = 14.0; cout << "Area of Equilateral Triangle is : "<<area(side); cout << "\nPerimeter of Equilateral Triangle: "<<perimeter(side); return 0; }
Output
Area of Equilateral Triangle is : 84.8705 Perimeter of Equilateral Triangle: 42
- Related Articles
- Program to calculate area and perimeter of equilateral triangle
- Swift Program to Calculate Area and Perimeter of Equilateral Triangle
- Program to calculate the Area and Perimeter of Incircle of an Equilateral Triangle What is Equilateral Triangle in C?
- Program to calculate area of Circumcircle of an Equilateral Triangle in C++
- Program to calculate area of Circumcircle of an Equilateral Triangle
- Program to calculate area and perimeter of Trapezium
- Area of circle which is inscribed in equilateral triangle in C Program?
- Calculate the area and perimeter of the following shapes:Q.1 Calculate the area of Square and rectangleQ.2 Calculate perimeter of Square and rectangle."
- Program to calculate area and perimeter of a rhombus whose diagonals are given What is rhombus in C++?
- C Program for Area And Perimeter Of Rectangle
- Explain the perimeter and area of a triangle.
- Program to Calculate the Perimeter of a Decagon in C program
- The side of an equilateral triangle is shown by ( l ). Express the perimeter of the equilateral triangle using ( l ).
- How to calculate the area and perimeter of a circle in JavaScript?
- Program to find the Area and Perimeter of a Semicircle in C++

Advertisements