Question: Product of an Array You are given an integer array A of size N . Your task is to find and return an integer value

Product of an Array
You are given an integer array A of size N. Your task is to find and return an integer value representing the product of all the elements in the array.
Input Specification:
input1 : An integer array A
input2 : An integer value N representing the size of the array
Output Specification:
Return an integer value representing the product of all the elements in the array.
Example 1:
input1: {2,4,6,8}
input2: 4
Output: 384
Explanation:
Here, the array is {2,4,6,8} and when all the elements are multiplied by each other *6*8=384) the product obtained is 384. Hence, 384 is returned as the output.
Example 2:
input1: {1,2,3,4,5}
input2 : 5
Output : 120
Explanation:
Here, the array is {1,2,3,4,5} and when all the elements are multiplied by each other 2**3**4**5=120) the product obtained is 120. Hence, 120 is returned as the output.
 Product of an Array You are given an integer array A

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!