+ 6

Simple definition or explanation of "return 0;"?...didn't get it clearly!

Can anybody please tell me about the return 0; part of the code.

4th Nov 2018, 5:27 PM
Nida
Nida - avatar
3 Réponses
+ 4
Ok. In main function the return 0 serves as a signal to you know your program exited correctely. Because people implemented that 0 equals exit success Anything that is not 0 ( generally we use 1) equals exit failure. But if i not use what happens? Here the answer: https://www.sololearn.com/discuss/1555239/?ref=app In an informal way you are saiyng your programs end here and if return 0 executes you are giving a signal that your program worked perfectly.
4th Nov 2018, 5:38 PM
Anya
Anya - avatar
+ 2
so, “return 0;” Means Your Program Has Exceeted properly, Then “return 1;” means that Your Program Has Not Exceeted Properly.
4th Nov 2018, 9:01 PM
Potato Hacker
Potato Hacker - avatar
+ 1
return 0 is simply the successful ending of a program, any other returned value means there is a prblm.
6th Nov 2018, 10:10 PM
Ahmad Labdo
Ahmad Labdo - avatar