I will assume that you are using double precision floating point arithmetic which complies with the IEEE 754 standard. I will use the following properties. Every normal DP number can be written as
$$ x = f \cdot 2^m, \quad, \quad $$
where the significand $f$ satisfies $$ f \in [1,2)$$ and the exponent $m$ satisfies
$$ m \in \{-1022,1023\}. $$
The smallest subnormal DP number is
$$ y = 2^{-1074}$$
and any result $z$ such that $|z| \leq y/2$ is rounded to zero using the standard rounding mode.
Given a sequence of numbers $\{x_j\}_{j=1}^n$ your task is to device a stable algorithm for computing the product $$p = \prod_{j=1}^n x_j.$$ Let us first consider the natural algorithm, i.e., $$p_1 = x_1, \quad p_j = p_{j-1} x_j, \quad j = 2, 3, \dotsc, n.$$
This algorithm is extremely vulnerable to floating point overflow/underflow. Consider the case of $$x_1 = x_2 = 2^{-600}, \quad x_3 = x_4 = 2^{600}.$$ It is clear that $$x_1x_2x_3x_4 = 1.$$ However, $$ p_2 = x_1x_2 = 2^{-1200}$$ which is flushed to zero, i.e., the computed value $\hat{p}_2$ of $p_2$ is $$\hat{p}_2 = 0.$$ We mention in passing that the relative error for $\hat{p}_2$ is $1$. Such a large relative error is unacceptable. If we instead attempt to compute $$q = x_3x_4 = 2^{1200},$$ then the computed result is $$\hat{q} = \infty,$$ because the calculation overflows. Naturally, we can be clever and compute $(x_1 x_3)(x_2 x_4)$ for which the computed value will be exact, but such cleverness is difficult to implement in general and is only possible when all terms available from the start.
Instead we exploit the fact that the numbers $x_j$ given as $$x_j = f_j \cdot 2^{m_j}, \quad f_j \in [1,2), \quad m_j \in \{-1022,1023\}.$$
I will now show how to obtain write $$p_j = g_j \cdot 2^{k_j}, \quad g_j \in [1,2), \quad k_j \in \mathbb{Z}.$$ I will proceed inductively. It is clear that $$g_1 = f_1, \quad k_j = m_j.$$ Moreover, if $$p_{j-1} = g_{j-1} \cdot 2^{k_{j-1}}, \quad g_{j-1} \in [1,2), \quad k_{j-1} \in \mathbb{Z},$$ then $$ p_j = g_{j-1} f_j \cdot 2^{k_{j-1} + m_j}.$$
We must now obtain expression for $g_j$ and $k_j$. By assumption $g_{j-1} f_j \in [1,4)$, hence $$g_{j-1} f_j = h \cdot 2^{r}, $$ where $$h \in [1,2), \quad r \in \{0,1\}.$$ We see that the choice of $g_j = h$ and $k_j = k_{j-1} + m_j + r$ ensures $$p_j = g_j \cdot 2^{k_j}.$$ This new algorithm will allow you compute the significand for the product as well as the correct exponent. Obviously, the final result is not necessarily in the representational range, but that is not your problem. It is possible to show that $g_j$ is computed with a relative error which is no worse that $$\gamma_{j-1} = \frac{(j-1) u}{1-(j-1)u} \approx (j-1) u$$
where $u = 2^{-53}$ is the DP unit roundoff. This proof is either easy or hard depending on which technique your class uses to analyse rounding errors.
In Matlab you can use the function log2 to isolate the exponent and the significand, but mind the fact that
$$[f, e]=\text{log2}(x)$$ returns
$0.5 \leq f \leq 1$. In C there is in math.h since C99 a function frexp which will do the same job.