Why is the result 17 | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 1

Why is the result 17

var result = 0; for i in 0...4 { if i == 3 { result += 10; } else { result += i; } } print(result)

5th Feb 2022, 1:12 AM
Daniel
1 Respuesta
+ 1
Thank you devanille
5th Feb 2022, 4:44 PM
Daniel