Java Program to Print Summation of Numbers
Given an array of integers, print the sum of all the elements in an array. Examples: Input: arr[] = {1,2,3,4,5} Output: 15 Input: arr[] = {2, 9, -10, -1, 5, -12} Output: -7 Approach 1: Iteration in an ArrayCreate a variable named sum and initialize it to 0.Traverse the array through a loop and add t