why we write return 0 only I tried to write return 7282 and it still work . what's the reason? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why we write return 0 only I tried to write return 7282 and it still work . what's the reason?

10th Jul 2016, 10:23 AM
RozeAbel
RozeAbel - avatar
2 Answers
+ 4
return 0 means the function closed normally. Numbers from 1-999 usally mean that an error occured. That's just convention ;)
10th Jul 2016, 11:14 AM
Niclas
Niclas - avatar
+ 2
You must be talking about the small example given in the "BASIC" of this app, as Mr Niclas said 0 means the function closed normally or was successful and other no mean that an error occurred. Simple program will work for any of the value as they have to compile only those small sentences but think of a complex program as soon as compiler will read other value than 0 it will stop there and not execute further sentences as for them any no other than 0 means an error occurred.
10th Jul 2016, 9:09 PM
imnoob
imnoob - avatar