Although this solution has the same time complexity as doing a two pass (you're just doing both processing in the single pass so they should be the same), I agree that having to write one loop is less tedious than writing 2 separate loops.
@mithun3. The idea is to store product of numbers at the left side to A and product of numbers at right side to B.
i.e. A[i] = nums * nums ... * nums[i-1]; B[i] = nums[N] * nums[N-1] ... * nums[i+1];
As you can plainly see, Result[i] = A[i] * B[i]