0
why return 0; is outside the loop?
array
7 Respuestas
+ 1
a question is given to print the array elements.in this question why we should take return 0 outside the for loop?
+ 1
thats partially true...return 0 means when the computer 'reads' return 0 it goes back from where the function was called ...with the value 0.
In case of main()...the computer or more precisely the control goes back to the console on which your program was running.
that is why if you run any program on pc the last thing you see is "program exited with code 0" or something similar
If you talk about functions other than main ()
(user defined functions) then the control returns back to the point where the corresponding function was called.
0
which program are you referring to please be more specific
0
this q/a section is common so , selecting discussion from anywhere will post your question here on one single place...so actually it is difficult to know what you are asking but i think i get it.
0
then please explain why
0
Now to get your answer please tell me what do you understand by 'return 0'?
0
return 0 means the end of a program.