Difficulty: Easy
Correct Answer: 1, 2, 5
Explanation:
Introduction / Context:
This conceptual question checks your knowledge of basic method (function) behavior in C#.NET: recursion, whether you can nest function definitions, what happens if a function omits a return value, how to return from the middle of a function, and whether function calls can be nested in expressions.
Given Data / Assumptions:
Concept / Approach:
Evaluate each statement against core C# rules: recursion is allowed; functions are defined at type scope (traditional teaching says no nested function definitions); there is no implicit -1 return; and C# uses the keyword return to exit a method early. Function calls can indeed be nested, as expressions can contain other calls.
Step-by-Step Solution:
Verification / Alternative check:
Compile small examples: a) recursion (factorial); b) nested calls like Math.Max(Math.Abs(-5), 3); c) attempt to omit a return in a non-void method will fail with a compiler error; d) “exit function” keyword is not recognized by C#; e) standard method declarations exist at type scope in typical codebases.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing C# with VB (using “exit function”), assuming a magic default return value, or thinking nested calls are disallowed.
Final Answer:
1, 2, 5
Discussion & Comments