0
Please explain below program. i got confused with the output 58 . How it was came?
int [ ] myArr = {6, 42, 3, 7}; int sum=0; for(int x=0; x<myArr.length; x++) { sum += myArr[x]; } System.out.println(sum); // 58
5 Answers
+ 1
Thank you
+ 1
Thank u swim
0
The aim of your code above was to sum up all the elements in the array