+ 1

What is the return 0 statment about?

About Return

26th Nov 2016, 12:32 AM
somdeep sengupta
somdeep sengupta - avatar
7 Réponses
+ 6
return 0 means that the main() function (and the program in general) ended properly. A value other than 0 means abnormal termination. The compiler adds it at the end if you don't write it, but it's a convention to have it explicitly written there.
26th Nov 2016, 12:36 AM
Tamra
Tamra - avatar
+ 3
return 0 used to return the value zero to the operating system
27th Nov 2016, 4:30 AM
Prabha Kumari
Prabha Kumari - avatar
+ 3
the compiler expects some of the return value after the program execution. it takes 0 as if the program compiled successfully and any other value as unsuccessful compilation.
29th Nov 2016, 4:57 PM
Rishabh Agrawal
Rishabh Agrawal - avatar
+ 1
Yes, you can skip the return 0;, but it's good style to have it written in the code
28th Nov 2016, 11:18 PM
Henry Riser
Henry Riser - avatar
0
The function output
13th Dec 2016, 2:10 PM
Raymond Hua
Raymond Hua - avatar
- 2
so we can skip return 0 , since the compiler adds it by default ?
26th Nov 2016, 12:52 AM
somdeep sengupta
somdeep sengupta - avatar
- 5
for fun
26th Nov 2016, 12:34 AM
script