C++ Functions True or False? ( a - g ) a. A function has exactly one return stat
ID: 3642244 • Letter: C
Question
C++ FunctionsTrue or False?
( a - g )
a. A function has exactly one return statement. (true/false)
b. A function has at least one return statement. (true/false)
c. A function has at most one return statement. (true/false)
d. A function with return value void never has a return statement. (true/false)
e. When executing a return statement, the function exits immediately. (true/false)
f. A function with a return value void must print a result. (true/false)
g. A function without arguments always returns the same value. (true/false)
Explanation / Answer
a. A function has exactly one return statement - True b. A function has at least one return statement - False c. A function has at most one return statement - True (Remarks for A, B and C - A function will execute only one return statement though it can have if loop and more return statement can be written inside it, but when it encounters a single return statement, it will exit the function.) d. A function with return value void never has a return statement - True e. When executing a return statement, the function exits immediately - True f. A function with a return value void must print a result - False (Remarks - it may not print any result) g. A function without arguments always returns the same value - False (Remarks - The function may use Instance/Global variables)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.