diff --git a/RightTriangleChecker.cpp b/RightTriangleChecker.cpp new file mode 100644 index 0000000..d349327 --- /dev/null +++ b/RightTriangleChecker.cpp @@ -0,0 +1,26 @@ +#include +using namespace std; + +bool checkRight(int a, int b, int c){ + if(a*a + b*b == c*c) + return true; + return false; +} + +int main(){ + int a,b,c; + + cout<<"Enter 1st number"<>a; + cout<<"Enter 2nd number"<>b; + cout<<"Enter 3rd number"<>c; + + if(checkRight(a,b,c)||checkRight(b,c,a)||checkRight(c,a,b)) + cout<<"Yes, it is a right triangle"<