0

When do we use return 1

17th Oct 2016, 6:29 PM
Aniket Foolchand
Aniket Foolchand - avatar
4 Answers
+ 2
You can technically return whatever integer you want in the main function, however, if I recall correctly, some compilers denote '0' as a successful execution.
18th Oct 2016, 6:28 AM
DaemonErrors
DaemonErrors - avatar
0
when you need "NOT"
17th Oct 2016, 7:30 PM
micbat
0
if you created a function of integer type then you can return any value but "it should be in integer type " so if you want to return 5 then you do so, ->because function "int main() " or any "int abc()" tells you to return a integer not tells you to return 0 only. example :-int main(){ int a=1,b=4; return a+b; } here you not have to return 0 because function already return an integer value, which is a+b
18th Oct 2016, 5:50 PM
Chetan kumar das
Chetan kumar das - avatar
0
When your programs exits with an error.
18th Oct 2016, 6:58 PM
V. A. Timiriliyev
V. A. Timiriliyev - avatar