+ 1

In hello world program why we need return ?

In hello world program why we need return ? return 0;

5th Dec 2019, 5:27 PM
Sivaprabu Ganesan
Sivaprabu Ganesan - avatar
2 Réponses
+ 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.
5th Dec 2019, 5:33 PM
Sivaprabu Ganesan
Sivaprabu Ganesan - avatar
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.
5th Dec 2019, 5:32 PM
Chetali Shah
Chetali Shah - avatar