Multiple choice technology programming languages

Which of the following is returned by the operating system if a C++ program completes successfully?

  1. No Value Returned

  2. -1

  3. 1

  4. 0

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

C++ programs conventionally return 0 to the operating system to indicate successful execution, following a universal programming standard. Non-zero return values typically signal errors or specific exit conditions. This convention allows scripts and other programs to programmatically detect whether a program completed successfully.