+ 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
2 Réponses
+ 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
+ 3
It's PHP.