Thanks alot MR. Ancient Dragon
But what do U mean by "the os may pass it on to another program which spawned it, or a shell script (batch file) might use it for something"
Program #1 can start (or spawn) Program #2 then wait for Program #2 to finish. After it finishes the operating system will send Program #2's return value from main() back to Program #1, which it can then use for whatever purpose it wants to. The same can be done in batch files (MS-DOS or MS-Windows) or shell scripts from *nix.