Thursday 25 August 2016

To find the area of the triangle.

#include<stdio.h>
#include<math.h>
void main()
{
  

    float a,b,c,s,area,k;
    printf("enter the three sides of triangle");
    scanf("%f%f%f",&a,&b,&c);
    s=(a+b+c)/2;
     k=s*(s-a)*(s-b)*(s-c);
     if(c<0)
     {
         printf("complex no");
     }
     else
    {
        area=sqrt(c);
    }
    printf("area of triangle is %f",area);
}


No comments:

Post a Comment