Return 0; | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Return 0;

can anyone please tell me what the return 0, does

14th Dec 2017, 5:13 PM
Jimmy
Jimmy - avatar
2 Answers
+ 8
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 a function where omitting return is allowed.
14th Dec 2017, 5:25 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 2
You self answered on your question
14th Dec 2017, 5:16 PM
Dmitry Solovyov
Dmitry Solovyov - avatar