Technically, in C or C++ main function has to return a value because it is declared as "int main"
which means "main function should return integer data type"
if main is declared like "void main", then there's no need of return 0.
Some compilers even accept and compile the code even if u dont write return 0. varies from compiler to compiler
void main is not allowed by the C++ standard (nor the C standard) and should not even compile.
The int value that main returns is usually the value that will be passed back to the operating system. 0 traditionally indicates that the program was successful.
You don't have to return 0 explicitly, because that'll happen automatically when main terminates. But it's important to keep in mind that main is the only function where omitting return is allowed.
A return value just ends the life of a variable or function return 0; simply ends everything you can also do return main();(well I think it works that way).
I'd just like to add to what some people have said: a compiler can be expected to implicitly add return 0 to main() because ISO C++ demands it (though I don't believe the same can be said for ISO C). Any compiler that doesn't is not standards-compliant.