Link Search Menu Expand Document

Product of Negatives

Print the product of all negative numbers in a given array of integers.

E.g. for [1, -3, 5, -1, 2] the output should be 3 (i.e. -3 * (-1) = 3)