Find two numbers in sorted array whose product is close to N
This answer is compilation of above comments but this include reasoning why this algorithm works.

1. find(A, val)
2.    start = 1
3.    end = A.length
4.    minn = (start,end)                //minn is pair used to store answer
5.    minnErr =   |A[start]*A[end]-val|        //minnErr is difference between best 
                                  //pair of values seen so far and targate value.
6.    while(start &lt; end)
7.        if (|A[start]*A[end]-val| &lt; minnErr) //if this pair of values is 
                                                      //even better than remember it.
8.            minnErr = |A[start]*A[end]-val|
9.            minn = (start, end)

10.       if A[start]*A[end] &gt; val:              // here
11.           end = end - 1
12.       elif A[start]*A[end] &lt; val:
13.           start = start + 1
14.       else:
15.              break
16. return minn


Algorithm works as follows:

here answer is pair of indices of element of array which has product closest to target 
value.


We keep two pointers $start$ and $end$. Which are initialized to $1$ and $array\space size$ respectively.
Now in every iteration we compare $A[start] * A[end]$ with $minnErr$. 
If current pair have better solution than we record it.
If $A[start]*A[end] &lt; val$ than we increase $start$ by $1$.
Now note that all $(i,j): i&lt; start, j\le end$ can never be solution because for any 
such $(i,j)$ we have $A[i]*A[j] \le A[start]*A[end] &lt; val$.
if $A[start]*A[end] &gt; val$ than we decrease $end$ by $1$.
Now here(considering decremented value of $end$) all $(i,j): i\ge start, j&gt;end$ can never be solution because for any such 
$(i,j)$ we have $A[i]*A[j] \ge A[start]*A[end] &gt; val$. 
if $A[start]*A[end] = val$ than we stop here as this is best solution.


credits:  @G. Bach, @greybeard