South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
total = 0
for each value in array
add value to total
Hmm i made a big mess up
I did something in the range of
for x = 0 to 29
sum = sum(x+1)
next x
it should be something like
sum=0
for i from 1 to 30
sum=sum+array
end for
i !helping u
for i = won't do your homework
while u = should be learning
Ruby:
[1,2,4,5].inject+)
it should be something like
sum=0
for i from 1 to 30
sum=sum+array
end for
I dare you to try that in brainf**k