Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class average
- {
- public static void main (String[] Args)
- {
- System.out.println(average(43,56,376,8));
- }
- public static int average(int...numbers)
- {
- int total = 0;
- for (int i =0; i < numbers.length ; i++)
- {
- total = total + i;
- }
- return total / numbers.length;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment