I'm bit lost here. I have a for loop which increases a value, something like this:
int nu01 = 10000;
int level = 0;
int increase = 35000;
for (int i = 0; i < 100; i++) {
nu01 = nu01 + increase;
level++;
System.out.println(nu01);
if (level > 50) {
increase = 45000;
}
This works fine, but I need sum of all numbers from loop as total:
loop: 10,20,30,40,50,70,90,120.... total:10,30,60,100,150,220,310,430...
I tried:
int total;
total=nu01 + nu01; //or nu01 + nu01 + increase;
But I get strange sums. So I need loop which increase numbers and sum of all those numbers. I hope this makes sense. Thanks.