Which statement is correct regarding main () function in C++? I. It is a user…

2021

Which statement is correct regarding main () function in C++?

I. It is a user defined function.

II. It is a pre-defined function.

  1. A.

    Only I

  2. B.

    Only II

  3. C.

    Both I and II

  4. D.

    Neither I nor II

Attempted by 931 students.

Show answer & explanation

Correct answer: A

Explanation

The main() function acts as the entry point for C++ programs.

Statement I is correct because the programmer must explicitly write the definition.

Statement II is incorrect as it is not a pre-defined library function.

Therefore, only Statement I is valid.

Explore the full course: Up Lt Grade Assistant Teacher 2025