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

formatting output

use Console. WriteLine to print the contents of the firstName variable to the screen.

CodeChallenge.cs
string firstName =
Console.ReadLine().ToString();
Console.WriteLine("Enter First Name")
firstName=Console.ReadLine();
Console.WriteLine("\n");

2 Answers

Antonio De Rose
Antonio De Rose
20,856 Points
// you have made the simple complex.
string firstName =
Console.ReadLine().ToString(); // no need to convert it to string.
Console.WriteLine("Enter First Name") // this was not a part of the challenge, please stick to the question only and only from treehouse, dont create yours own.
firstName=Console.ReadLine(); //not sure, why is this
Console.WriteLine("\n"); // no need to create a new line

string firstName = Console.ReadLine();
Console.WriteLine(firstName);
Console.WriteLine(firstName + " rocks!");

thanks