Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

Calculate Area of Triangle with given three sides

/* Program Calculate Area of Triangle when three side are given */
/* here a,b,c are sides of triangle and s is semiperimeter */
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
 
{
   float a,b,c,s,area;
   clrscr();
   /* reading part */
   printf("Enter Three side of triange  -> ");
   scanf("%f%f%f",&a,&b,&c);
   /* processing part */
   s=(a+b+c)/2.0;
   area=sqrt(s*(s-a)*(s-b)*(s-c));
   /*display result */
   printf("Side1 =%7.1f\nSide2 =%7.1f\nSide3 =%7.1f\n",a,b,c);
   printf("\nArea of Triange  :-> %8.4f \n",area);
   getch();
}