exit

Terminates the program with normal cleanup actions.

  exit(int status)
  
Remarks

The function exit() has additional behavior in the following order:

If status is zero or EXIT_SUCCESS, a successful termination is returned to the host environment.

If status is EXIT_FAILURE, an unsuccessful termination is returned to the host environment.

Otherwise the status returned to the host environment is implementation-defined.