If main returns a non-zero value you will get a Run Time Error. However, with a C99 compiler this should not happen
as long as you (a) declare main to return int, and (b) do not explicitly return a non-zero value. If you declare main to return, e.g., float or void you will get undefined behavior, likely to result in a Run Time error. It never hurts to have an explicit return 0 at the end of main, though.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article