Answer to Question #270145 in C for Sherlock

Question #270145

5. Write a C program to calculate area of an equilateral triangle.

1
Expert's answer
2021-11-23T05:18:30-0500
#include<stdio.h>
#include <math.h>
int main(){
	float s, area;


   
    printf("Enter side the triangle: ");
    scanf("%f", &s);


   
    area = (sqrt(3) / 4) * (s * s);


    
    printf("Area of equilateral triangle = %.2f sq. units", area);


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS