Exit is a jump statement that is used in the C and C++ programming languages. It takes an integer to depict different exit status of the program. It tells whether the program was successfully terminated or not.
exit(0): exit(0) or exit success depicts that the program has been successfully terminated, without any occurence of errors and interrupts.
exit(1): exit Failure or exit(1) indicates that the program faced an abnormal termination, due to the occurence of interrupts or errors.