+ 1
What is "return 0"
Why do we always return 0 at the end of a program while the program is expected to return something So what is this "return 0"
3 Answers
+ 2
return is a command used to return any value at the end of a function.
return 0 is mostly used in c++ to return null value in the main function.
It is used only if the function defined is not already a void function like ' void main() '
when void is mention it is implied that return value is 0 and 'return 0 ' doesn't have to be specified
+ 1
Thanks @barathan and @jamie for helping me understand