Find a distinct pair ( x , y ) in given range such that x divides y | C ++ implementation of the approach ; Function to return the possible pair ; ans1 , ans2 store value of x and y respectively ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findpair ( int l , int r ) { int ans1 = l ; int ans2 = 2 * l ; cout << ans1 << " , ▁ " << ans2 << endl ; } int main ( ) { int l = 1 , r = 10 ; findpair ( l , r ) ; }