Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main()
  4. {
  5. float y;
  6. float x;
  7. float z;
  8. float s;
  9. double area=sqrt(s(s-x)(s-y)(s-z));;
  10.  
  11. s=(x+y+z)/2;
  12.  
  13.  
  14.  
  15. printf("State the triangles sides in cm ");
  16. scanf("%f\n%f\n%f", y, x, z);
  17.  
  18. area=sqrt(s(s-x)(s-y)(s-z));
  19.  
  20. if ((y+x>z) && (x+z>y) && (z+y>x))
  21. {
  22. printf("The area is %f cm^2", area);
  23. }
  24. else
  25. {
  26. printf("The sides length is not viable to create a triangle");
  27. }
  28.  
  29. getchar();
  30. getc(stdin);
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement