Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- float y;
- float x;
- float z;
- float s;
- double area=sqrt(s(s-x)(s-y)(s-z));;
- s=(x+y+z)/2;
- printf("State the triangles sides in cm ");
- scanf("%f\n%f\n%f", y, x, z);
- area=sqrt(s(s-x)(s-y)(s-z));
- if ((y+x>z) && (x+z>y) && (z+y>x))
- {
- printf("The area is %f cm^2", area);
- }
- else
- {
- printf("The sides length is not viable to create a triangle");
- }
- getchar();
- getc(stdin);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement