From 4fd699eea9d7be5e0555519c69b8a7c4e9291891 Mon Sep 17 00:00:00 2001 From: saisameer010 <32016435+saisameer010@users.noreply.github.com> Date: Thu, 31 Oct 2019 14:12:17 +0530 Subject: [PATCH] Right Angle Problem --- right angle pair.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 right angle pair.cpp diff --git a/right angle pair.cpp b/right angle pair.cpp new file mode 100644 index 0000000..1c928c5 --- /dev/null +++ b/right angle pair.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; + +int main() { + // your code goes here + cout<<"enter 3 numbers\n"; + float a,b,c; + cin>>a>>b>>c; + float small = (ab)?((a>c)?a:c):((b>c)?b:c)); + float med; + if (a==small || a==big) + { + if (c==small || c== big) + { + med=b; + } + else + med=c; + } + else + { + if (c==small || c== big) + { + med=a; + } + else + med=c; + } + + if (((small*small)+(med*med))==(big*big)) + cout<<"right angle pair"; + else + cout<<"NOT a right angle pair"; + return 0; + + +}