+ 1
In hello world program why we need return ?
In hello world program why we need return ? return 0;
3 Answers
+ 1
Yea @Swim i got clear explanation in next slode thanks for your comment
return 0; This statement terminates the main() function and returns the value 0 to the calling process. The number 0 generally means that our program has successfully executed. Any other number indicates that the program has failed.
0
Share your code.
There can be many possible cases:
1. If you are using void main() then there is no need to return.
2. If you have used int main() then the return type of main is int that's why you are returning 0.
As you have tagged void main then along with void you don't need to return anything.