Answer the question
In order to leave comments, you need to log in
Displaying multiple values to the console at once does not work. Where is the mistake?
string name = "Tom";
int age = 34;
double height = 1.7;
bool isEmployment = false;
Console.WriteLine($"Name: {0} Age:{1} Height: {2} Employment: {3},", name, age, height, isEmployment);
Answer the question
In order to leave comments, you need to log in
if you write in this format, then you need to erase the $.
if you want to write through the format with $, then instead of 0,1,2,3 substitute variable names inside parentheses.
Option 1:
Console.WriteLine("Name: {0}", name);
Option 2:
Console.WriteLine($"Name: {name}");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question