The operating system calls main. When main returns, the program is done.
main is the front door. The operating system starts your program by calling main, and when main returns, the program is over. Everything else you write is either called from here or never runs.
int main(void).loads the executable
Your code is not running yet.your statements run
This is the only entry in this program.status code
Non-zero usually means failure.reaps the process
The program is done.Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. Who calls main?
The OS starts the process at main.
2. int main(void) means:
void = no args; int = status.
3. A non-zero return from main usually means:
Convention: 0 ok, non-zero error.
4. When main returns, the program is:
Returning ends the hosted program.
5. Command-line arguments use which form later?
argc/argv is the hosted args form.