2.multiplication of Array Elements
2.multiplication of Array Elements
PrepBuddy is happy that you solved the previous questions, just to be sure that you
are comfortable with operators and arrays, he is giving you this problem. You are
provided with the size of the array represented by NN and NN array elements. You
need to output the multiplication of all the elements. See sample test cases for better
understanding.
Input Format
First line contains the value of test case variable TT . Then follows TT test cases.
First line contains NN representing the size of the array. Second line contains NN
space-separated integers.
Output Format
Constraints
1<=N<=91<=N<=9 1<=A[i]<=101<=A[i]<=10
Time limit
11 secon
Example
Input
22 55 11 22 33 44 55 77 99 8844 33 11 22 33
Output
120120 51845184
Sample test case explanation
Test case variable T=2T=2 For T=1T=1 N=5N=5 Array = [[11 , 22 , 33 , 44 ,
55]] Multiplication = 1 ∗ 2 ∗ 3 ∗ 4 ∗ 5=120 1 ∗ 2 ∗ 3 ∗ 4 ∗ 5=120
For T=2T=2 N=7N=7 Array = [[99 , 88 , 44 , 33 , 11 , 22 , 33]] Multiplication =
9 ∗ 8 ∗ 4 ∗ 3 ∗ 1 ∗ 2 ∗ 3=5184