Q26
What is the correct way to declare a method named GetAbsoluteValue that takes an integer parameter num and returns its absolute value in C#?
A.
GetAbsoluteValue(num) { return Math.Abs(num); }
B.
int GetAbsoluteValue(int num) { return Math.Abs(num); }
AnswerC.
GetAbsoluteValue { return Math.Abs(num); }
D.
None of the above
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board