Saturday, January 14, 2012

AREA OF TRIANGLE(HERO'S FORMULA)


#include<math.h>
#include<stdio.h>
#include<conio.h>
void main()
{
 float s,a,b,c,e,area=0;
 clrscr();
 printf("Enter the value of side 1:");
 scanf("%f",&a);
 printf("\nEnter the value of side 2:");
 scanf("%f",&b);
 printf("\nEnter the value of side 3:");
 scanf("%f",&c);
 s=(a+b+c)/2;
 e=(s*(s-a)*(s-b)*(s-c));
 area=sqrt(e);
 printf("area of triangle is= %f",area);
 getch();
 }

1 comment:

  1. Looking for a hassle-free pathway to secure a seat at Vydehi Medical College? College Dhundo offers valuable insights on "Direct Admission In Vydehi Medical College Direct Admission In Vydehi Medical College Explore this informative resource to simplify your admission process and achieve your medical education goals.

    ReplyDelete