Simple. Its the recursive code to find the sum of numbers upto given parameter. Since u passed 100, its the sum of numbers from 1 through 100 which is 5050. In the second return statement, there is a recursive call with a value 1 less than parameter. This is where the logic lies.