What is the difference between executing the return 0; statement and its rough equivalent, a call to the exit(0); function, or the difference between return 1; and exit(1);?

a) These are very nearly equivalent anywhere they are encountered.
b) These are very different if encountered in a function other than main();.The
exit function terminates the program, returning control to the operating system,
whereas return only terminates the function, returning control to the calling
function.
c) These are very nearly equivalent when executed in the main function. In main,
these both terminate main and send a success code to the operating system,
returning control to the operating system.
d) Both these return control to the free store manager by way of the exception
controller, sending the argument as an error code.

b) These are very different if encountered in a function other than main();.The
exit function terminates the program, returning control to the operating system,
whereas return only terminates the function, returning control to the calling
function.
c) These are very nearly equivalent when executed in the main function. In main,
these both terminate main and send a success code to the operating system,
returning control to the operating system.

Computer Science & Information Technology

You might also like to view...

Explain how the process of analyzing the tblMember table changed your database?

What will be an ideal response?

Computer Science & Information Technology

How can space be added between paragraphs without pressing the Return key more than once?

What will be an ideal response?

Computer Science & Information Technology