SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to calculate area of equilateral triangle
C program to calculate area of equilateral triangle
Output:
Enter the side of the equilateral triangle: 3
Area of equilateral triangle is 3.897114
Implementation:
#include
#include
#include
int main(void) { float area,side; float val; printf("Enter the side of the equilateral triangle:\n"); scanf("%f",&side); /* calculating the area of the equilateral triangle sqrt(3) * side * side area= --------------------- 4 */ val = sqrt(3); area = (val*side*side)/4; printf("Area of equilateral triangle is %f\n",area); return 0; }
PREVIOUS
NEXT
HOME