A function with a non-void return type is expected to return a value. If no return statement is used, the behavior of the program becomes undefined. This means that it may work as intended in some cases but fail unpredictably in others. The compiler might not catch this error and will likely generate a warning instead. It’s crucial to ensure all code paths in such functions reach a return statement to avoid unpredictable results or potential crashes.