C Program To Calculate The Area Of An Equilateral Triangle

ADVERTISEMENTSC program to calculate the area of an equilateral triangle
  • Last Updated :20 Nov, 2021
ADVERTISEMENTS

C program to calculate the area of an equilateral triangle. There are you will learn how to find the area of an equilateral triangle in the C language.

Formula:

a = (sqrt(3) / 4) * (s * s)

Where:

a = area

s = side

Let us understand this example through the C program:

// C program to calculate the area of an equilateral triangle #include <stdio.h> #include <math.h> // Used for sqrt() function int main() { float s, a; // s = side // a = area printf("Enter the side of an equilateral triangle::\n"); scanf("%f", &s); // Calculate area of equilateral triangle a = (sqrt(3) / 4) * (s * s); // Output printf("\nArea of the equilateral triangle = %f sq. units", a); return 0; }

Run Program

Output:

Enter the side of an equilateral triangle::

7

Area of the equilateral triangle = 21.217623 sq. units

  • Share on :

Hope, This article was helpful?YesNo

Sorry about that

How can we improve it? Submit FeedbackThank you for helping us improve this article.ADVERTISEMENTS
  • Write A C++ Program To Add Two Matrix Of Order 4 4
  • C++ Program To Find The Income Tax
  • C++ Program To Find The Sum Of The Digits Of An Integer Number
  • C++ Program To Calculate Area And Circumference Of Circle Using Function
  • C++ Program To Find Sum Of Series 1 3 5 7
  • C++ Program To Display Largest Element Of An Array
ADVERTISEMENTS

Related Articles

C Program Of Simple Bubble Sort Implementation Using Array Ascending Order...

C Program For Insertion Sort In Descending Order...

C Program For Selection Sort Algorithm In Data Structure...

C Program To Implement Oddeven Sorting...

C Program For Selection Sort In Descending Order...

C Program For Shell Sort In Data Structure...

X ADVERTISEMENTS

Tag » Area Of Equilateral Triangle C Program