You are given a function, int ProductArray(int arr, int n); The function accepts an integer array 'arr'
Fantastic news! We've Found the answer you've been seeking!
Question:
You are given a function, int ProductArray(int arr, int n); The function accepts an integer array \'arr\' of length \'n\'. Implement the function to modify the given array such that, value at each index is replaced with product except for the integer on that index. 7444-3043615 Assumption: Array index starts from 0. n> I Each product operation is within the integer range. Note: Input and output arrays are of same length. Example: Input: arr: 2 3 7 5 Output: 105 70 30 42 Explanation: arr[0] = arr[1] arr[2] arr[3] = 3*7*5=105, similarly all other elements are replaced with product of all integer of the array except the integer on that pa The custom input format for the above case: 2 3 7 5 (The first line represents \'n\', the second line represents the elements of the array \'arr\') Sample input arr: 4 6 5 Sample Output 30 20 24
Posted Date: