Concept Flow - Upto and downto methods
Start number
Check condition: current <= end (upto) or current >= end (downto)?
|Yes
Execute block with current
Update current: current + 1 (upto) or current - 1 (downto)
Back to condition check
End
↩Back to condition check
The methods start from a number and move up or down to another number, running code at each step until the end is reached.