There are still a few small problems.
1) you should change your for loop to run until the end of the array instead of hardcoding a value:
// this is bad
for (int i=0; i<10; i++) {
// this...
Type: Posts; User: Cornix
There are still a few small problems.
1) you should change your for loop to run until the end of the array instead of hardcoding a value:
// this is bad
for (int i=0; i<10; i++) {
// this...
What you want to do is sum up the elements of the array.
Think about it without writing code. Try to write the steps down one by one on a piece of paper.
You have a list of numbers. You can always...
By declaring it outside of the loop.
By the way, I dont understand your calculation within the loop. You add all numbers 10 times?