Question: plz solve in java We have written a method called sun with an int[] parameter nums. We want our sum method to compute the sum
We have written a method called sun with an int[] parameter nums. We want our sum method to compute the sum of nums, but our code has a bug (or perhaps bugs?) in it. TASK: Fix the bug(s) Sample Input: 1 2 3 4 5 Sample Output: 15 Write a program, test using stdin - stdout Time limit: 8 seconds Memory limit: 256 MB 1 static int sum(int[] nuns) { 2 int total -e; 3 for(int num : nums) { // for-each loop total + num; 1 point per submission Submit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
