+ 2
What is return 0;
what is return 0; in c++ programming . what is its use
11 Answers
+ 2
A function may return a value. The return_type is the data type of the value the function returns. Some functions perform the desired operations without returning a value. In this case, the return_type is the keyword void.
+ 2
You an also ommit return 0; at the end of your main function and it gets generated automatically.
+ 2
chandrapal singh Yes.
+ 2
chandrapal singh What I wrote: It will be generated automatically.
+ 1
You can use any number but 0 is used for tell to calling system eventual that execution was go ok with no errors (you can run a process by another process and wait for result)
+ 1
means
+ 1
chandrapal singh Your code will work as if you had written return 0; at the end of your main function.
0
bhai app India se ho
0
if i don't write return0
0
then what will happen
0
In the main function itâs the âconventionalâ return code to the caller from an application which exited with no error.
You can change this value at will, for example return 9 if you canât read a file, return 5 if your app couldnât connect to a database, etc..