Ad
Code
Diff
  • public class Average {
       public static int averageFinder(int[] arr) {
          int total = 0;
          for(int num: arr){
             total += num;
          }
          return total / arr.length;
       }
    }
    • public class Average {
    • public static int averageFinder(int[] arr) {
    • int total = 0;
    • for(int num: arr){
    • total += num;
    • }
    • int result = total / arr.length;
    • return result;
    • return total / arr.length;
    • }
    • }