Microsoft
MB6-869 · Question #34
In Microsoft Dynamics AX 2012, what is the return value of the following method, for an initial value of x = 5? static int sampleSwitch(int x) { ; switch (x) { case (1): x = 5; case (5): x = x + 5…
The correct answer is C. 20. See the full explanation below for the reasoning.
Question
In Microsoft Dynamics AX 2012, what is the return value of the following method, for an initial value of x = 5? static int sampleSwitch(int x) { ; switch (x) { case (1):
x = 5; case (5):
x = x + 5; case (10):
x = x + 10; break; case (20):
x = x + 20; break; default:
x = 5; } info(strfmt("Return value is %1", x)); return x; }
Options
- A5
- B10
- C20
- D25
How the community answered
(27 responses)- A11% (3)
- B4% (1)
- C81% (22)
- D4% (1)
Community Discussion
No community discussion yet for this question.