If a function is not declared void then you MUST have a return statement telling what should be the value when returning to the caller. If you fail to do so and simply the function end without returning a value the result of calling this function is "Undefined Behavior" that means that your program could do anything (including crashing or deleting everything that is on your hard disk).
Normally if the value is just a simple int you will get funky numbers, but in more complex cases can be a source of big troubles. Just don't do that.
Compilers will normally inform you that you forgot a return statement if properly instructed to do so (i.e. by enabling the maximum warning level). You can omit to return a value only for cases where the function doesn't actually return (i.e. throws an exception or loops forever).
Also, because of a crazy special rule of the C++ language, the function main can end without a return statement despite being declared as returning an int. Don't waste your time your time looking for a logical reason for this exception, there's none.