C Program to Calculate Area of Equilatral Triangle

C Programming Language Fundamentals of C Language (Article) Fundamentals of C Language (Program)

2420

Program:

#include"stdio.h"
#include"math.h"
int main() {
   int side;
   float area, r_4;
 
   r_4 = sqrt(3) / 4;
 
   printf("\nEnter the Length of Side : ");
   scanf("%d", &side);
 
   area = r_4 * side * side;
 
   printf("\nArea of Equilateral Triangle : %f \n", area);
   return (0);
}

Output:

Enter the Length of Side : 6

Area of Equilateral Triangle : 15.588457
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.