0

Why 30?

Explain, please, on your fingers, why the output is 30. https://code.sololearn.com/cDcb4tGHpD1i/?ref=app

23rd Jul 2020, 3:12 PM
Михаил
5 ответов
+ 4
func( func(x, y), func(x, y) ) add( add(5, 10), add(5, 10) ) add(5, 10) = 15 add(15, 15) 15 + 15 = 30
23rd Jul 2020, 3:16 PM
Bagon
Bagon - avatar
+ 2
Михаил , there are nested functions in this example. The result comes after replacing add(add(5, 10), add(5, 10)) => add(15, 15) => 30.
23rd Jul 2020, 3:18 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
Your x and y takes the value of the sum of a and b which is 5+10= 15. So "x+y" gives 15+15= 30.
23rd Jul 2020, 3:16 PM
Rawley
Rawley - avatar
+ 1
Rawley Bagon ,thanks so much
23rd Jul 2020, 3:18 PM
Михаил
23rd Jul 2020, 3:20 PM
Михаил