Skip to content
Justice Tech School

C# Output and Formatting

Console.Write prints without a newline. String interpolation with $ inserts values, and format specifiers control numbers such as :F2 for two decimals and :C for currency.

Example
double p = 1234.5;
Console.Write("A");
Console.WriteLine("B");
Console.WriteLine($"{p:F2} | {p:N0} | {0.256:P0}");

Exercise

Insert a value into a string.

$"Hi {}"

Quiz Test

Which prefix enables interpolation?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.