Why not "return 0 " is placed after " int main(){......}" at end of program ... than placing inside "int main" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why not "return 0 " is placed after " int main(){......}" at end of program ... than placing inside "int main"

25th Oct 2016, 6:01 PM
Bhargav
4 Answers
+ 2
int main() is the program, anything outside of its scope isn't used. The purpose of return 0 is only applicable to main, since it tells the computer the program terminated normally.
26th Oct 2016, 12:16 AM
Verdayne Graham
Verdayne Graham - avatar
0
a function's scope is contained inside the curly brackets {}, anything outside that scope is not a part of the function
25th Oct 2016, 6:17 PM
Fhatuwani Luvhengo
Fhatuwani Luvhengo - avatar
0
int main () is variable because when we write a program and compile it and he is done
26th Oct 2016, 3:09 AM
Jahanzaib korai Khan
Jahanzaib korai Khan - avatar
- 1
can do {} is was a body of the program.. return 0 was end of the process
28th Oct 2016, 3:42 AM
Hearley P