First, fix the indentation of triangle. This will make things a lot easier, because it won't confuse abachler.
Next, your explanation of the second line of the for loop was wrong:
Try again to explain what this line does.Code:return sum;
First, fix the indentation of triangle. This will make things a lot easier, because it won't confuse abachler.
Next, your explanation of the second line of the for loop was wrong:
Try again to explain what this line does.Code:return sum;
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law