0
Why do we put a return zero command at the end in c++?
Is there any reason of just to make code more readable??
6 Answers
+ 3
By standards return type of main is treated as exit code of the program. If you return 0 at the end then it is treated as normal exit without any errors
and Saboor Hakimi đŠđ« if you don't specify any return type then it is by default treated as 0
0
Let me show you a trick about how to run a C++ programme without returning 0 at the end, but don't ask how!
0
Run this code
#include <iostream>
using namespace std;
#undef int
int main() {
cout << "Hello, World!";
}
0
Thanks for sharing...đ€