Last active
April 30, 2017 14:40
-
-
Save jetnew/6911ea4417820f7fce47edc3b02a987c to your computer and use it in GitHub Desktop.
To check for right angled triangle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <cs50.h> | |
int main(void) | |
{ | |
//declare function to check validity of right angled triangle | |
bool valid_righttriangle(float x, float y, float z) | |
{ | |
//to check using Pythagoras' Theorem | |
if (x*x + y*y = z*z) || (x*x + z*z = y*y) || (y*y + z*z = x*x) | |
{ | |
return true | |
} | |
return false | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment