Multiple choice technology programming languages

Default return type of functions in C++ is

  1. Void

  2. Int

  3. Bool

  4. none of the above

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

In C++, if no return type is specified for a function, the default return type is 'int'. This is a legacy feature from C. However, it's considered poor practice - always explicitly specify the return type. The 'void' return type means the function returns nothing, while 'bool' is for boolean return values.