Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.h>
  3.  
  4. int main(void)
  5. {
  6. //declare function to check validity of right angled triangle
  7. bool valid_righttriangle(float x, float y, float z)
  8. {
  9. //to check using Pythagoras' Theorem
  10. if (x*x + y*y = z*z) || (x*x + z*z = y*y) || (y*y + z*z = x*x)
  11. {
  12. return true
  13. }
  14. return false
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement