C program to find area of an equilateral triangle






C program to find area of equilateral triangle
How to calculate area of an equilateral triangle in c programming language


#include<stdio.h>
#include<math.h>
int main(){
    float side;
    float area;
    printf("Enter length of any side of equilateral triangle: ");
    scanf("%f%",&side);
    area = (sqrt(3)/2)*(side*side);
    printf("Area of equilateral triangle : %f",area);
    return 0;
}



2 comments:

lussy said...

It's cool n 100% working.. great idea.. thanks

s.m. dilhari said...

#include
int main()
{
int basis;
int height;
int area;
area =1/2*basis*height;
printf("Enter value for basis:\n");
scanf("%d",basis);
printf("Enter value for height :\n");
scanf("%d",height);
printf("Area");
printf("\n area : %d",area);
return 0;





}


wot about this one... help me because iam a beginner to the C