How to find area of isosceles triangle in C

2 Answers

0 votes
#include <stdio.h>
#include <math.h>

int main(void) {
    double a = 5; // length of two equal sides
    double base = 8;

    double area = (1 / 2.0) * base * sqrt((a * a) - ((base * base) / 4));

    printf("Area of Isosceles Triangle = %f", area);
}





/*
run:

Area of Isosceles Triangle = 12.000000

*/

 



answered Aug 15, 2021 by avibootz
0 votes
#include <stdio.h>

int main(void) {
    double h = 3;
    double base = 8;

    double area = (1 / 2.0) * base * h;

    printf("Area of Isosceles Triangle = %f", area);
}





/*
run:

Area of Isosceles Triangle = 12.000000

*/

 



answered Aug 15, 2021 by avibootz
edited Aug 15, 2021 by avibootz

Related questions

2 answers 192 views
2 answers 182 views
2 answers 179 views
2 answers 173 views
2 answers 171 views
171 views asked Aug 14, 2021 by avibootz
2 answers 153 views
2 answers 151 views
...