exit()- Utility Function
How is Utility Function "exit()" used in C++?
How to terminate the program using c++?
is a Utility Function that causes the program to terminate normally . An exit_code is passed to the calling program, if this is "0" or EXIT_SUCCESS it is normal termination. If the exit_code is non-zero or EXIT_FAILURE indicates an error.
void exit (int exit_code);
int main ()
printf ("Print text");
printf("Will not be displayed");
In the above example exit() function terminates the program, after the first "printf" statement is executed.