C# C# Basics (Retired) Console I/O Formatting Output

can you help me to format this problem

i dont know how to do any of these code challenges can you please just give me an example because every time i try it says im declaring the variable wrong

string firstname;

1 Answer

Tsenko Aleksiev
Tsenko Aleksiev
3,814 Points

First you tell the computer what type your variable is, in your example is string ( text between quotes aka “Tsenko” ), than you name your variable, for example firstName and than you give your variable a value which you asign with the “=“ operator. So all is: string firstName = “Tsenko”; Using Console.ReadLine(firstName); you just tell the computer to print you what’s inside the firstName variable, so the result will be “Tsenko”. Got it? The variable is like a box you place something inside and name the box with a pencil. So when you write the name of the box, it shows what’s inside.