The exit function can be used to terminate program execution and return a specified value as program status to the calling program, usually the operating system. A zero value indicates success. An example of the exit function indicating unsuccessful termination of a program is shown below.
exit (1);
The abort function, on the other hand, is used to abnormally terminate the program. This function displays a message “Abnormal Program termination” and exits the program. A typical call to this function takes the following form:
abort();