2 ответов
+ 1
It is:
5 * 4 +
4 * 3 +
3 * 2 +
2 * 1 +
1 * 0
Then number is 0 and the while loop finishes. The first number on each line is the value for number.
+ 1
total = (0)+ 5*4
total = (5*4)+4*3
total = (5*4+4*3)+3*2
total = (5*4+4*3+3*2)+2*1
total = (5*4+4*3+3*2+2*1)+1*0
the return statement is used outside the while loop thus you get a output of 40 at last