Saturday, July 16, 2011

Write a c program to find the area of an equilateral triangle




C
program for area of equilateral triangle








Formula of
area of equilateral triangle:

Area = (v3)/4 * a2



C code:



#include

#include



int main(){



float a;

float area;



printf("Enter
size of side of the equilateral triangle : ");

scanf("%f",&a);



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



printf("Area of equilateral
triangle is: %.3f",area);



No comments:

Post a Comment