How do we multiple 20 variables in array in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How do we multiple 20 variables in array in java

variables in array

6th May 2017, 8:31 AM
George Adu-gyan
George Adu-gyan - avatar
7 Answers
+ 2
Do you want to save 20 variables in an array? Just make an array of size 20 and add the variables
6th May 2017, 9:34 AM
‎ɐısıօլɐ
‎ɐısıօլɐ - avatar
+ 2
yes, I agree with MR Programmer, we didn't understand you, I didn't understand that you meant MULTIPlY because multiple means lots of and not multiply
6th May 2017, 10:19 AM
‎ɐısıօլɐ
‎ɐısıօլɐ - avatar
0
I couldn't get you try to explain more.
6th May 2017, 8:39 AM
MR Programmer
MR Programmer - avatar
0
the is... /** * @(#)Multilication_Array.java * * Multilication_Array application * * @author * @version 1.00 2017/4/26 */ public class Multilication_Array { public static void main(String[] args) { int[] values = {10, 20, 35, 45, 52, 9, 14, 101, 34, 56, 66, 89, 12, 39, 67, 89, 20, 80, 40, 45}; int result=1; for(int value : values){ result *=value; } // TODO, add your application code System.out.println("The result: " + result); } }
6th May 2017, 9:57 AM
George Adu-gyan
George Adu-gyan - avatar
0
that is the answer
6th May 2017, 9:57 AM
George Adu-gyan
George Adu-gyan - avatar
0
you should tell about this that you want to get the product of all 20 element of array
6th May 2017, 10:01 AM
MR Programmer
MR Programmer - avatar
0
ok
6th May 2017, 10:14 AM
George Adu-gyan
George Adu-gyan - avatar