Write a C program to find the area of a triangle using Heron's Formula.
Program:-
#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
{
float a, b, c, s, area;
printf("Enter the length of three sides of triangle\n");
scanf("%f %f %f", &a, &b, &c);
s = (a + b + c)/2;
area = sqrt(s*(s-a)*(s-b)*(s-c));
printf("Area of triangle : %f", area);
getch();
return 0;
}
Output :-
Input:
Enter the three sides of the Triangle
a=?
a=?
b=?
c=?
Output:-
...
0 comments:
Post a Comment