Write a program in Java to enter the elements of an array with 20 elements from the user
Answers
Answered by
1
Explanation:
To find the sum of elements of an array.
- create an empty variable. ( sum)
- Initialize it with 0 in a loop.
- Traverse through each element (or get each element from the user) add each element to sum.
- Print sum.
Similar questions