+ 3

Hi, could You tell me, please why not 11 but 21 in the example below. Also It's out of all standarts twice "return" s? Thank 's

Tell me, please step by step. - -:) https://code.sololearn.com/w1p1xIzcFb6q/?ref=app

28th Oct 2019, 6:52 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
2 odpowiedzi
+ 4
6+5+4+3+2+1=21 It's a backwards loop, because: math(6) = 6 + math(5) = 6 + 5 + math(4) = 6 + 5 + 4 + math(3) = 6 + 5 + 4 + 3 + math(2) = 6 + 5 + 4 + 3 + 2 + math(1) = 6 + 5 + 4 + 3 + 2 + 1 + math(0) And math(0) = 0 So result = 6+5+4+3+2+1
28th Oct 2019, 7:04 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 3
It's PHP.
29th Oct 2019, 12:12 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar