Guest User

Untitled

a guest
May 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. public class Mean {
  2. public static void main(String[] args) {
  3. double array[] =
  4. {0.0d, 1.0d, 2.0d, 3.0d, 4.0d, 5.0d, 6.0d, 7.0d, 8.0d, 9.0d};
  5. double sum = 0.0;
  6. for (double elem: array)
  7. sum += elem;
  8. System.out.println(sum/array.length);
  9. }
  10. }
Add Comment
Please, Sign In to add comment