Multiple choice technology programming languages

C++

  1. int main()

  2. int main(int argc, char *argv[])

  3. They both work

  4. None of the Above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Both int main() and int main(int argc, char *argv[]) are valid main function declarations in C++. The first is for programs without command-line arguments, the second accepts command-line arguments. Both work correctly.