For what do we need return 0? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

For what do we need return 0?

4th Feb 2018, 8:57 PM
Daniel Gonzalez
Daniel Gonzalez - avatar
3 Answers
+ 4
return 0; is a statement that returns to the main function call, and acts as a "Hey, the program executed successfully!"
4th Feb 2018, 9:08 PM
Dread
Dread - avatar
+ 9
return 0 is used for normal termination of your main function , if return 1 is used then your program enters a abnormal termination
5th Feb 2018, 11:24 AM
Daniel Săvescu
Daniel Săvescu - avatar
+ 5
Okay thanks
4th Feb 2018, 9:09 PM
Daniel Gonzalez
Daniel Gonzalez - avatar