1. Write a program to calculate the area of triangle using formula A=(s(s-a)(s-b)(s-c))^1/2

SOURCE CODE:

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

int main()
{   float a,b,c,s,A;
    printf("enter the sides of triangle\n");
    scanf("%f %f %f",&a,&b,&c);
    s=(a+b+c)/2.0;
    A=sqrt(s*(s-a)*(s-b)*(s-c));
    printf("Area of the triangle is %f",A);

    return 0;
}

Comments