Dsa
Math
Easy
Cumulative Product
Given an array of integers, calculate the cumulative product of the elements at each index. Output a new array where each element at index i is the product of all elements from the input array up to index i. The input will consist of a single line with space-separated integers. The output should be a single line with the cumulative product values, space-separated.
Example:
Input:
2 3 4
Output:
2 6 24
Key concepts
arraysmathcumulative
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now