String interpolation

You have used the concept of string interpolation while writing the C# code snippet given below.

const int FieldWidthRightAligned = 20; 
Console.WriteLine($"{Math.PI,FieldWidthRightAligned:F3}");

In this context, which of these is the correct output of the code snippet?

Options
  1. 3.142
  2. 3.14
  3. 3.1
  4. 3.1415
Previous PostNext Post

Related Posts

Close Bitnami banner
Bitnami