When to use exit(0) and exit(1)?

Answer

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. 

All c++ Questions

Ask your interview questions on c

Write Your comment or Questions if you want the answers on c from c Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---