195k views
2 votes
The exit() function requires which library and how many parameters does it take?

1 Answer

7 votes

Final answer:

The exit() function is part of the stdlib.h library in C and is used to terminate a program and return a status code to the operating system. It takes one parameter, which is the status code.

Step-by-step explanation:

The exit() function is part of the stdlib.h library in C programming language. It is used to terminate a program and return a status code to the operating system. The exit() function takes one parameter, which is the status code.

Here is an example:

#include <stdlib.h>
int main() {
// Program code
exit(0);
return 0;
}

User Johnny Klassy
by
7.1k points