Guest User

Untitled

a guest
Apr 16th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public class average
  2. {
  3.    public static void main (String[] Args)
  4.    {
  5.    
  6.       System.out.println(average(43,56,376,8));
  7.    
  8.    
  9.    }
  10.  
  11.    public static int average(int...numbers)
  12.    {
  13.       int total = 0;
  14.    
  15.       for (int i =0; i < numbers.length ; i++)
  16.       {
  17.          total =  total + i;
  18.    
  19.       }
  20.       return total / numbers.length;
  21.    
  22.    }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment