MCQs > IT & Programming > C# > What will be the output of the following code? int[] nNumArr = {1, 2}; foreach (int temp in nNumArr) {temp++; Console.WriteLine(temp);

C# MCQs

What will be the output of the following code?

int[] nNumArr = {1, 2};
foreach (int temp in nNumArr)
{
temp++;
Console.WriteLine(temp);
}


Answer

Correct Answer: Error because you cannot increment temp by 1

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it