How to use exit ()? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to use exit ()?

Which header file should be included?

22nd Aug 2017, 4:11 AM
Supratim Majumder
Supratim Majumder - avatar
1 Answer
+ 1
not sure which programming language you are referring to but I think cstdlib should work for c++ example: #include <cstdlib> #include <iostream> using namespace std; int main() { cout<<"Program will exit"; exit(1); // Returns 1 to the operating system cout<<"Never executed"; }
22nd Aug 2017, 5:08 AM
Infant Raj
Infant Raj - avatar