Find x , y , z that satisfy 2 / n = 1 / x + 1 / y + 1 / z | CPP program to find x y z that satisfies 2 / n = 1 / x + 1 / y + 1 / z ... ; function to find x y and z that satisfy given equation . ; driver program to test the above function
#include <bits/stdc++.h> NEW_LINE using namespace std ; void printXYZ ( int n ) { if ( n == 1 ) cout << -1 ; else cout << " x ▁ is ▁ " << n << " STRNEWLINE y ▁ is ▁ " << n + 1 << " STRNEWLINE z ▁ is ▁ " << n * ( n + 1 ) ; } int main ( ) { int n = 7 ; printXYZ ( n ) ; return 0 ; }