This is because, the function is called 11 times when you pass 10 as num. So in the last(11th) call, num=0, and the function returns in an order, whiles adding num. And at the end, the return int would be 55.
So basically, it is not a problem.
You can try the logic yourself and see, or post for how I got it.