#include <stdlib.h>void exit(int exit_code);
The exit( ) function causes immediate, normal termination of a program. This means that termination functions registered by atexit( ) are called and any open files are flushed and closed.
The value of exit_code is passed to the calling process, usually the operating system, if the environment supports it. By convention, if the value of exit_code is zero, or EXIT_SUCCESS, normal program termination is assumed. A nonzero value, or EXIT_FAILURE, is used to indicate an implementation-defined error.
Related functions are atexit( ), abort( ), and _Exit( ).