Results 1 to 3 of 3
Thread: Help adding doubles to an array
- 10-18-2012, 08:11 PM #1
Member
- Join Date
- Apr 2012
- Location
- St. Louis, MO
- Posts
- 32
- Rep Power
- 0
- 10-18-2012, 08:16 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Re: Help adding doubles to an array
??
yourArray[n] = Euclid; (please follow the naming conventions!)
- 10-18-2012, 08:47 PM #3
Senior Member
- Join Date
- May 2012
- Posts
- 170
- Rep Power
- 2
Re: Help adding doubles to an array
You can probably create an arraylist
Java Code:ArrayList<Double> lol = new ArrayList<Double>(); for(int n=1;n<10; n++) { double Euclid=Math.pow(2,n-1)*(Math.pow(2, n)-1); lol.add(Euclid); //adding the number in to the array list } //printing the result System.out.println("Numbers:"); for(int i=0;i<lol.size();i++){ System.out.println(lol.get(i)); }WARNING I am Russian so it's possible that I wont understand you correctly...
Similar Threads
-
fill a rectangular array from a text file of doubles
By dilley in forum New To JavaReplies: 3Last Post: 06-18-2012, 09:44 AM -
Adding all elements of an Array together, not adding up correctly
By Teclis in forum New To JavaReplies: 1Last Post: 04-05-2011, 08:58 PM -
Array always adding to 0???
By Javawizard in forum New To JavaReplies: 6Last Post: 11-13-2010, 11:02 PM -
adding to an array
By mayhewj7 in forum New To JavaReplies: 14Last Post: 02-19-2009, 05:41 AM -
Adding numbers in array
By Shaolin in forum New To JavaReplies: 1Last Post: 11-15-2007, 06:30 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks