Saturday 8 April 2017

C Program to Find Area of a Triangle


Program :-

#include <stdio.h>
#include <math.h>
main()
{
   float x,y,z,s,area;
   printf("enter sides ");
   scanf("%f %f %f ",&x,&y,&z);
   s = (x + y + z) / 2 ;
   printf("area =  %f ", sqrt(s*(s - x)*(s - y)*(s-z)) );
}
 
Output :-

enter sides :
4  4  2
area = 3.87


No comments:

Post a Comment

How to Invert an SVG image using CSS ?

You can invert your svg easily by using following css code svg { -webkit-filter: invert(100%); /* safari 6.0 - 9.0 */ filter...