It returns the value to the caller. If you leave out the return statement from main it will automatically return 0 (meaning the program ended correctly). If you leave out the return statement from a non-void function other than main the behaviour is undefined which means that there is no guarantees what will happen. It might work, but don't rely on it.