Why do you write the line: yourName = Console.ReadLine();?

12/1/2016 5:17:33 PM

Bryan De Costa

1 Answer

New Answer


The 'Console.ReadLine(); ' means the program will read a line of text the user types. 'yourName' stores what the program read. It doesn't have to say YourName though. You can declare any string variable. String yourname creates the variable, but you can use 'String DuckFart' and type in DuckFart instead of yourName. 'Console.WriteLine(yourName);' will display whatever text was stored in the 'yourName' variable. Example: if user types 'Bob' (program reads what user typed and stored data in yourName) Output of WriteLine will be 'Bob' (program writes what is in yourName on screen)