+ 2
Why dont we used return 2; instead of return 0; ??
hey help me plz
5 Answers
+ 4
you can use return 2 too or return any int or int variable if main is int declared return tells the program which variable to return inside function main is also a function and follows these
+ 3
You can return any value you like, it's still going to bring the program to an end. However, zero is prefered because it is a C++ standard that the return value of zero indicates that the program has run successfuly without any issues. Another return value (usually 1), indicates that there was a problem with the program, and did not end as expected. These non-zero return codes can help diagnose issues if we were to run our program from an external source.
+ 2
u can..
but return type must be int
we write return 0 coz of int main()..
int main() must return some integer that's y we use return 0
+ 1
I'm good
0
thank u soo much all of you It helped me