Pythagorean Quadruple | C ++ code to detect Pythagorean Quadruples . ; function for checking ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool pythagorean_quadruple ( int a , int b , int c , int d ) { int sum = a * a + b * b + c * c ; if ( d * d == sum ) return true ; else return false ; } int main ( ) { int a = 1 , b = 2 , c = 2 , d = 3 ; if ( pythagorean_quadruple ( a , b , c , d ) ) cout << " Yes " << endl ; else cout << " No " << endl ; }