Is using exit() the same as using return?

No. The exit() function is used to exit your program and return control to the operating system. The return statement is used to return from a function and return control to the calling function. If you issue a return from the main() function, you are essentially returning control to the calling function, which is the operating system. In this case, the return statement and exit() function are similar.  

Showing Answers 1 - 3 of 3 Answers

R.S.Jayasatahyanarayanan

  • Dec 27th, 2006
 

no both r not same because

exit()->this function work is to end the  program completely

return()->This fucntion return the values where it will be call

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions