Glossary term
What is accumulator? Meaning for developers
A variable that collects a result across iterations. Start it at 0 (for a sum) or 1 (for a product), then add or multiply inside the loop.
Learn it properly · DSALesson 4: The for LoopThe most important idea in this series. Start, condition and update, traced step by step with a dry-run table until the pattern is clear.