Pair of integers with difference K having an element as the K | C ++ Program to implement the above problem ; Function to find the required pair ; No pair possible ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void computePair ( double K ) { if ( K == 1 ) { cout << " No " ; return ; } else { cout << K * K / ( K - 1 ) << " ▁ " ; cout << K / ( K - 1 ) << endl ; } } int main ( ) { double K = 6 ; computePair ( K ) ; return 0 ; }