Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- #include<conio.h>
- //Calculate area of the triangle when three sides are given
- int main()
- {
- int a,b,c;
- double s,area;
- printf("Enter three values: \n");
- scanf("%d %d %d",&a,&b,&c);
- s=(a+b+c)/2;
- area = sqrt(s*(s-a)*(s-b)*(s-c));//its Heron's formula for the area of a triangle
- printf("area of triangle : %.2lf",area);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement