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


hie guys cn u help me out here how do i Declare a variable named firstName and initialize it to the string returned from a call to Console.ReadLine()


1 Answer

Fredrik Rönnehag
Fredrik Rönnehag
2,341 Points

Just like you would declare a variable of type int or string.

string name = "John";

Except here you ask the user to input his name and you save it in a string variable named firstName.

string firstName =

// I leave the last part to you!

okay thnks ey got it