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 Say Hello!

Shawn Jass
Shawn Jass
7,151 Points

CodeChallenge Say Hello, what is the correct code. Why am I getting error asking what I have typed between the "" ?

Why am I getting an error asking what I have typed in between the parenthesis? And double quotes?

CodeChallenge.cs
class CodeChallenge
{
    static void Main()
    {
        // Prompt the user for Hello
        System.Console.Write("Hello: ");


    }
}

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Shawn,

It's because you added way more than what the challenged asked for. The challenge simply asked to "Write the word "Hello" to the console in the code provided below." And I'm not sure why you have a colon and a space after "Hello"?

So, the answer is just one line of code:

System.Console.Write("Hello");

The trick is not to overthink the challenges. :)

:dizzy: