What happens if the return statement does not produce a return value in a function that produces a return value in C language? Does the compiler use garbage values in this case? Is this called undefined behavior?
For example;
#include <stdio.h>int func() {}int main() { int result = func(); printf("Result: %d\n", result); return 0;}
Output of this code :Result: 0
I am expecting this is a undefined behavior.