It evaluates the expressions given as argument. void exit(int status) Experience.Reports the successful termination/completion of the program.Reports the abnormal termination of the program.Reports the termination when the program gets executed without any error.Reports the termination when some error or interruption occurs during the execution of the program. Declaration.

acknowledge that you have read and understood our,GATE CS Original Papers and Official Keys,ISRO CS Original Papers and Official Keys,ISRO CS Syllabus for Scientist/Engineer Exam.How to use getline() in C++ when there are blank lines in input?scanf() and fscanf() in C – Simple Yet Poweful,getchar_unlocked() – faster input in C/C++ for Competitive Programming,Problem with scanf() when there is fgets()/gets()/scanf() after it.Differentiate printable and control character in C ?Measure execution time with high precision in C/C++,Measure execution time of a function in C++.How to measure time taken by a function in C?Print a long int in C using putchar() only,Convert a floating point number to string in C.How to write a running C code without main()?Modulo Operator (%) in C/C++ with Examples.C Programming For Beginners - A 20 Day Curriculum!Difference between Static and Dynamic Memory Allocation in C,exit(0) vs exit(1) in C/C++ with Examples,Pointers in C and C++ | Set 1 (Introduction, Arithmetic and Array).What are the differences between bitwise and logical AND operators in C/C++?Difference and Similarities between PHP and C,INT_MAX and INT_MIN in C/C++ and Applications,fesetround() and fegetround() in C++ and their application,Lex program to take input from file and remove multiple spaces, lines and tabs,Queries to insert, delete one occurrence of a number and print the least and most frequent element,Get first and last elements from Array and Vector in CPP,Similarities and Differences between Ruby and C language,Code Optimization Technique (logical AND and logical OR),Similarities and Differences between Ruby and C++,Generate an array of given size with equal count and sum of odd and even numbers,Similarities and Difference between Java and C++,Getting System and Process Information Using C Programming and Shell in Linux,Change/add only one character and print '*' exactly 20 times,Array of Structures vs.

It is declared in “stdlib.h” header file. Live Demo Active 4 years, 3 months ago. There are two types of exit status in C/C++: Exit Success: Exit Success is indicated by exit(0) statement which means successful termination of the program, i.e. In the case of exit (0), you're calling a function. CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100 If status is EXIT_FAILURE, an unsuccessful termination status is returned to the host environment. Array within a Structure in C/C++,Top 10 Programming Languages for Blockchain Development,How to call function within function in C or C++,C/C++ program for calling main() in main(),Average of Cubes of first N natural numbers,Difference between Type Casting and Type Conversion,what happens when you don't free memory after using malloc(),Output of C programs | Set 66 (Accessing Memory Locations),C program to display month by month calendar for a given year,Draw a Chess Board using Graphics Programming in C,Why do we need reference variables if we have pointers, header file in C with Examples,How To Run CUDA C/C++ on Jupyter notebook in Google Colaboratory,Draw a smiley face using Graphics in C language,Difference between Identifiers and Variables in C,What are the C programming concepts used as Data Structures,How to use make utility to build C projects?`,Difference Between malloc() and calloc() with Examples,Understanding "volatile" qualifier in C | Set 2 (Examples).isalpha() and isdigit() functions in C with cstring examples.strtok() and strtok_r() functions in C with examples,set_symmetric_difference in C++ with Examples,quick_exit() function in C++ with Examples,C program to check if a given year is leap year using Conditional operator,Difference between Sentinel and Counter Controlled Loop in C,Getting System and Process Information Using C Programming and Shell in Linux,Difference and Similarities between PHP and C.What are the differences between C and Embedded C?How to find index of a given element in a Vector in C++,How to iterate through a Vector without using Iterators in C++,How to initialize Array of objects with parameterized constructors in C++.Rust vs C++: Will Rust Replace C++ in Future ?Write Interview As exit() function calls, it terminates processes. The _Exit() function in C/C++ gives normal termination of a program without performing any cleanup tasks.

Don’t stop learning now. If status is zero or EXIT_SUCCESS, a successful termination status is returned to the host environment.

It is used to terminate the program or let the control exit out of the program.

Viewed 2k times -5.

The C library function void exit(int status) terminates the calling process immediately. exit(0) vs exit(1) in C/C++ with Examples; Java System.exit(0) vs C++ return 0; Exit status of a child process in Linux; Features of C++; Draw a triangle in C++ graphics; Implementation of lower_bound() and upper_bound() in List of Pairs in C++; How to Setup VSCode with C, C++ and Python for Competitive Programming; Java System.exit(0) vs C++ return 0 ; Features of C++17 with Examples; … Definition of exit(0) The function exit(0) is a jump statement of C++. By using our site, you Otherwise, the status returned depends on the system and library implementation.