ArrayTest2 - double x={12,34,17,2,96,44,72,63}; double...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class ArrayTest2 { // Store the following data in an integer array // then calculate and print out the sum of their square roots // 12, 34, 17, 2, 96, 44, 72, 63 / public static void main(String [] args) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double x={12,34,17,2,96,44,72,63}; double sum=0; for(double i=0;i<x.length;i++){ sum+=x[Math.sqrt(i)]; } System.out.println("Sum="+sum); } }...
View Full Document

Ask a homework question - tutors are online