Prototype: void exit(int ExitCode);
Header File: stdlib.h (C) or cstdlib (C++)
Explanation: Exit ends the program. The ExitCode is returned to the operating system, similar to returning a value to int main.
//Program exits itself
//Note that the example would terminate anyway
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
    cout<<"Program will exit";
    exit(1); // Returns 1 to the operating system

    cout<<"Never executed";
Other Functions