Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
Code
Diff
  • public class Average {
       public static int averageFinder(int[] arr) {
          int total = 0;
          for(int num: arr){
             total += num;
          }
          return total / arr.length;
       }
    }
  • 11 public class Average {
    22 public static int averageFinder(int[] arr) {
    33 int total = 0;
    44 for(int num: arr){
    55 total += num;
    66 }
    7- int result = total / arr.length;
    8- return result;
    7+ return total / arr.length;
    99 }
    1010 }