what is the work of retun 0; ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the work of retun 0; ?

why this statment is used in this program what is the basic need of this statement what is the statement

12th Jul 2019, 2:15 AM
praveen prajapat
praveen prajapat - avatar
1 Answer
0
I'm assuming that you are referring to main function. when returning 0 it gives OS a signal that your program exits successfully(no error occurred). value other than 0 indicating that error occurred. return 0 statement is optional, since you don't return value from main to other functions(no functions would call main function since the program starts from main function)
12th Jul 2019, 3:07 AM
Payton Zhong
Payton Zhong - avatar