Hello all,
Is there a way to Add a list of numbers in the Sequence they are in the list?
List (1,2,3,4,5,6)
How I want to add
1
1+2
1+2+3
1+2+3+4
Ex…
Thanks
Hello all,
Is there a way to Add a list of numbers in the Sequence they are in the list?
List (1,2,3,4,5,6)
How I want to add
1
1+2
1+2+3
1+2+3+4
Ex…
Thanks
Matt,
Thank you very much. Both of your solutions work perfectly.
And a for loop?
a=[Imperative]
{
b=1..5;
c=0;
d={};
e=0;
for (i in b)
{
d[e]=i+c;
c=d[e];
e=e+1;
}
return = d;
};