Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Mean {
- public static void main(String[] args) {
- double array[] =
- {0.0d, 1.0d, 2.0d, 3.0d, 4.0d, 5.0d, 6.0d, 7.0d, 8.0d, 9.0d};
- double sum = 0.0;
- for (double elem: array)
- sum += elem;
- System.out.println(sum/array.length);
- }
- }
Add Comment
Please, Sign In to add comment