Header Ads Widget

Responsive Advertisement

Find Area of a Triangle using Heron's formula

 #include<stdio.h>

#include<math.h>

int main ()

{

    float a,b,c,s;

    float area ;

    printf("Enter the value of a\n : ");

    printf("Enter the value of b\n : ");

    printf("Enter the value of c\n : ");

    scanf("%f%f%f",&a,&b,&c);

    s=(a+b+c)/2;

    area=sqrt(s*(s-a)*(s-b)*(s-c));

    printf("Area of triangle %f\n",area);

    return 0;


}


Post a Comment

0 Comments