Program to calculate area and perimeter of equilateral triangle | CPP program to find area and perimeter of equilateral triangle ; Function to calculate Area of equilateral triangle ; Function to calculate Perimeter of equilateral triangle ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float area_equi_triangle ( float side ) { return sqrt ( 3 ) / 4 * side * side ; } float peri_equi_triangle ( float side ) { return 3 * side ; } int main ( ) { float side = 4 ; cout << " Area ▁ of ▁ Equilateral ▁ Triangle : ▁ " << area_equi_triangle ( side ) << endl ; cout << " Perimeter ▁ of ▁ Equilateral ▁ Triangle : ▁ " << peri_equi_triangle ( side ) ; return 0 ; }