1. Exit is used to end the program at any time while the program is running, and exit parameters are returned to the OS. The Exit function is also implicitly called at the end of the main function. The Exit Function first executes the function that is enlisted by the atexit () function, and then does some of its own cleanup, refreshes all output streams, closes all open streams, and closes temporary files created by the standard I/O function tmpfile (). Exit is the end of a process that deletes the memory space used by the process while returning the error message to the parent process, and return returns the function value and exits the function.
2. Return is a language-level, which represents the call stack returns, and exit is the system call level, which represents the end of a process.
The 3.exit function exits the application and returns a state of the application to the OS, which identifies some running information for the application. and the machine and the operating system is generally 0 for normal exit not 0 for abnormal exit
function prototype void exit (int status); (header file stdlib.h)
4. Return is returned function call, if return is the main function, then exit the program
Exit is to force the program to quit at the call, and the program ends at once.