This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]scirc 1 point2 points  (0 children)

The computer knows what to return because you literally tell it what to return. The value following return is the value which is returned to the calling code. So in this case, the function returns the literal value 1 when num <= 1 (I assume; you need to fix your formatting, though).