I have an array x = #(1,2,3...,n) . How can i create an array y :
y[1] = x[1]
y[2] = x[1] + x[2]
y[3] = x[1] + x[2] + x[3]
.................
y[n] = x[1] + x[2] + x[3] + .... +x[n]
Can you give me the funtion ? Thank you for your help
Forum topic · General Scripting
By alexnguyen · 2016-03-03
I have an array x = #(1,2,3...,n) . How can i create an array y :
y[1] = x[1]
y[2] = x[1] + x[2]
y[3] = x[1] + x[2] + x[3]
.................
y[n] = x[1] + x[2] + x[3] + .... +x[n]
Can you give me the funtion ? Thank you for your help
Comments (2)
Comment policy
here..suppose it easy to make the fn yourself...
thats the formula... you could convert it to array of number (result) too with little tweak
`
here u go