MCQ
Q.
What is the primary function where the execution of a C++ program begins?
Correct Answer: A
The correct answer is main().
🔑 Key Points
- Every executable C++ program must have a function named
main(). - Program execution always starts from the first statement inside the
main()function. - It serves as the entry point of the application.
- The
main()function returns an integer value (typically 0 for successful execution) to the operating system.
📄 Additional Information
- Other functions can be defined in a C++ program, but they are called either directly or indirectly from
main(). - The standard C++ signature for
main()isint main()orint main(int argc, char* argv[]), whereargcandargvare used for command-line arguments.