Skip to main content
C# / .NET Output Prediction Easy +10 XP

String Interpolation

What does this output?

C# / .NETRead-only
string name = "World";
Console.WriteLine($"Hello, {name}!");

What is the output?

Show answer and explanation

Answer: Hello, World!

C# string interpolation uses $ prefix and {variable} syntax to embed values in strings.

Hint: $ enables string interpolation in C#.

What this challenge tests

Output Prediction in C# / .NET: strings, interpolation.

Related challenges