Computer Science, asked by asadDANIHAL, 1 year ago

WHAT I S return0; explain it​


divergent07: return 0 returns the value to void main and u will able to see results on screen
divergent07: without it program will run but u will not see any results
asadDANIHAL: hellio

Answers

Answered by ilmaishtiaq21
1

In C and C++ programs the main function is of type int and therefore it should return an integer value. The return value of the main function is considered the "Exit Status" of the application. On most operating systems returning 0 is a success status like saying "The program worked fine".

Almost in every program, The code there is mostly

return 0;

In the end of main function. I know This means all things are going on way. But what does it mean? What exactly are there at the background of this ? Thanks.

On most operating systems returning 0 is a success status like saying "The program worked fine". In C++ it is optional to type "return 0;" at the end of the main function and the compiler includes it automatically.

Thanks

Similar questions