MCQ
Q.
What is the essential function where the execution of every C++ program begins?
Correct Answer: A
The correct answer is main().
🔑 Key Points
- The
main()function is the entry point of every C++ program. - Execution always starts from the first statement inside the
main()function. - It typically returns an
intvalue (usually0for successful execution) to the operating system. - Without a
main()function, a C++ program cannot be compiled and executed.
📄 Additional Information
- The full signature often seen is
int main()orint main(int argc, char* argv[]). - The name
mainis a special keyword and cannot be used for other functions. - Other programming languages might use different entry points, e.g.,
public static void main(String[] args)in Java.