C Program to calculate the Area of the Triangle by using its three sides

//Program to calculate the Area of the Triangle by using its three sides
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
  float area,s,a,b,c;
  clrscr();
  printf("Enter three sides of the Triangle for calculating Area\n");
  scanf("%f%f%f",&a,&b,&c);
  s=(a+b+c)/2;
  area=sqrt(s*(s-a)*(s-b)*(s-c));
  printf("\nThe Area of the Triangle is = %f",area);
 
  getch();
  return 0;
}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

No comments:

Post a Comment