How does this pseudocode with polynomials print 30? I realize this is a stupid question

28 Views Asked by At
n = 0
for (i = 10, i >= 0, i = i - 2)
    n = n + i
print(n)

I ran through this, and I got 2 instead of 30, which is correct, of course. Here's the part where I ask a stupid question: Why is it 30?

If someone could explain each step of the process to get to 30, that'd be helpful. Imagine you were explaining it to a complete layperson.

0

There are 0 best solutions below