Exit in C++ by R4R Team

What is Exit() in c++ :
-exit() is the function in C++ which are use to close the program.
-When we run any program, it execute line by line then when it goes on line exit() then program will close(Terminate) automatically.

program:

#include < iostream>

using namespace std;

int main()
{
cout<<"First linen";
exit(0);
cout<<"Second line";
return 0;
}


output-

First line

-In this program, we print "First line" then we exit the program using exit() function that's by "Second line" is not display.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!