Quiz Yourself: C# Basics
Check your understanding of C# case sensitivity, syntax rules, type casting, and control flow structures.
We'll cover the following...
We'll cover the following...
C# Basics Quiz
1.
You are reviewing the following code snippet running in a C# 14 / .NET 10 environment:
int[] scores = [10, 20, 30];
foreach (int score in scores)
{
if (score < 15)
{
score += 5;
Console.Write(score);
}
}
What is the result of compiling and running this code?
A.
It prints 15 and updates the array.
B.
It prints 15 but does not update the array.
C.
It throws a runtime exception at the assignment.
D.
It fails to compile with error CS1656.
1 / 14