ar1 [ 0. . m - 1 ] and ar2 [ 0. . n - 1 ] are two given sorted arrays and x is given number . This function prints the pair from both arrays such that the sum of the pair is closest to x .
void printClosest ( int ar1 [ ] , int ar2 [ ] , int m , int n , int x ) {