American Express Interview Question

Explain why for loop output is 3 instead of 4.