What is the issue with the following function?
public string GetName(int iValue)
{
string sValue = "0";
switch (iValue)
{
case 1:
sValue = iValue.ToString();
case 2:
sValue = iValue.ToString();
break;
default:
sValue = "-1";
break;
}
return sValue;
}
Correct Answer: The code will not compile as there is no break statement in case 1.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More C# MCQ Questions