0
What is the use of the return function in c programming? How relevant can it get?why it is usually followed by 0 and not other?
As a beginner, when I learn simply code like printing Hello world the function usually ends by writing return (0); when I omitted it , the program works. When I change the number, the program works. So, why we really use return statement
2 Answers
0
return can be followed by an integer or string as well. Generally, it specifies the the value a function returns to another function which called it.
0
The return statement is used to see if a problem occured in the program. If it returns 0, then it had no errors. Anything other than 0 usually tells you and error occured