Find a distinct pair ( x , y ) in given range such that x divides y | Java implementation of the approach ; Function to return the possible pair ; ans1 , ans2 store value of x and y respectively ; Driver Code
class GFG { static void findpair ( int l , int r ) { int ans1 = l ; int ans2 = 2 * l ; System . out . println ( ans1 + " , ▁ " + ans2 ) ; } public static void main ( String args [ ] ) { int l = 1 , r = 10 ; findpair ( l , r ) ; } }