I’m guessing that you are only supposed to sum positive numbers. That means that you need to check if ele
is greater than 0
before adding it.
This sounds like homework so I’ll let you figure out the exact code
I’m guessing that you are only supposed to sum positive numbers. That means that you need to check if ele
is greater than 0
before adding it.
This sounds like homework so I’ll let you figure out the exact code