The main() function is:
-
to write output to the screen
-
the program entry point
-
Both correct
-
Both wrong
Reveal answer
Fill a bubble to check yourself
B
Correct answer
Explanation
In C, main() is the designated entry point where program execution begins. While it can perform output (A), its primary definition is the entry point (B). Option C is false because A describes a function, not the definition of main.
AI explanation
In C, C++, and Java, main() is the designated function where program execution begins — the runtime looks for it specifically to start running the program. It isn't inherently about writing output (a program's main could do anything, including nothing visible), so tying its definition to screen output is incorrect.