- 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
Environmental Science
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
How to Calculate Area of Equilatral Triangle using C Language
#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", area);
return (0);
}
Output :
Enter the Length of Side : 5
Area of Equilateral Triangle : 10.82
Properties of Equilateral Triangle :
Equilateral triangle is a triangle in which all three sides are equal .
All angles are of measure 60 degree
A three-sided regular polygon
Formula to Calculate Area of Equilateral Triangle :
Explanation of Program :
First of all we have to find the value of Root 3 / 2. So we have used following statement to compute the value.
r_4 = sqrt(3) / 4 ;
Now after computing the value of the Root 3 by 2 we have multiplied it by Square of the side.
area = r_4 * side * side ;
- Related Questions & Answers
- How to calculate gross salary of a person using C Program
- Write a ‘C’ Program to compute the sum of all elements stored in an array using pointers
- How to find area and circumference of circle using C Programming
- How to Calculate Area of Rectangle using C Program
- How to print hello world using C Language
- Write C Program to Delete duplicate elements from an array
- How to Calculate Area of Equilatral Triangle using C Language
- Find Second largest element in an array using C Programming
- Write C program to find Exponent Power Series
- How to Solve Second Order Quadratic Equation Using C Program
- How to Check Whether Number is Perfect Or Not using C
- How to convert temperature from degree centigrade to Fahrenheit using C
- Write C Program to Calculate Addition of All Elements in Array
- How to check the type of triangle using C
- How to calculate sum of 5 subjects and find percentage Using C Program
- How to find gretest in 3 number using C Programming
Advertisements
ads