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.
- A.
Only I
- B.
Only II
- C.
Both I and II
- 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.