Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

Brandon Holmes
Brandon Holmes
124 Points

Is this not what it is asking for?

It seems to be what it is asking for. What am I doing wrong? Thanks for the help!

CodeChallenge.cs
namespace System
{
  class Program
  {
      static void Main()
      {
          Console.Write("Enter your name:");

          string firstName = Console.ReadLine();

          Console.WriteLine("Hello" + firstName + ",have a good day!");

      }
  }
}

1 Answer

Johnathan Bender
Johnathan Bender
5,860 Points

You need to add space after the "Hello". Otherwise it will display "HelloBrandon".

Brandon Holmes
Brandon Holmes
124 Points

Thanks! This is for the test in the beginner C# class. It is asking me to: Declare a variable called firstName and write it to a string using Console.ReadLine(). Why would this not be working?