Quiz Yourself: C# Basics

Check your understanding of C# case sensitivity, syntax rules, type casting, and control flow structures.

We'll cover the following...

C# Basics Quiz

1.

What happens when you execute the following code snippet?

string[] colors = { "Red", "Green" };
Console.WriteLine(colors[2]);
A.

It prints null to the console.

B.

It prints an empty line to the console.

C.

It causes a compile-time error.

D.

It throws a System.IndexOutOfRangeException at runtime.


1 / 14