Math, asked by julia12353, 6 months ago

In c++ (return 0) means

Answers

Answered by neno290406
1

Answer:

Up vote 0. The main function is generally supposed to return a value and after it returns something it finishes execution. The return 0 means success and returning a non-zero number means failure. Thus we "return 0" at the end of main function. But you can run the main function without the return 0.It works the same .

Answered by ananaydubey
0

In C and C++ programs the main function is of type int and therefore it should return an integer value. . On most operating systems returning 0 is a success status like saying "The program worked fine". In C++ it is optional to type " return 0; " at the end of the main function and the compiler includes it automatically

Return 0 implies that the program ran without an error and succesfully exited. return 1 implies that the program had an error and did not successfully run usually return 1 is used to denote that the program did not run as expected.

Similar questions