The return value could have been any valid integer value, 0 is an integer value. The function requires an int be returned, no matter what the operation is.
In addition to FurryGuy answer: it is a good idea to throw exception here instead of returning some value. I beleve only reason why it is not done is because exceptions were not taught yet.