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!

Raymond Yam
PLUS
Raymond Yam
Courses Plus Student 345 Points

I am trying to print the word Hello, yet I was unable to do so. I have used all formats and included double quotation.

class Program { static void Main() { // Prompt the user for the word "Hello" System.Console.Write("Hello: "); // Print Hello } }

Am I supposed to just put System.Console.Write("Hello: ") here? I used both formats but it is keep giving me an error. Please help.

CodeChallenge.cs
class Program
{
    static void Main()
    {
        // Prompt the user for the word "Hello"
        System.Console.Write("Hello: ");
        // Print Hello
    }
}
Iskander Ismagilov
Iskander Ismagilov
13,298 Points

Use only the command to write "Hello" and don't forget semicolon.

1 Answer

Steven Parker
Steven Parker
231,275 Points

The challenge instructions are: "Write the word "Hello" to the console in the code provided below.". And it provides this starter code:

System.Console.Write();

So all you need to do is add the word as an argument to the call. You will not create a complete program structure around it. And be sure to use the word exactly as given with no punctuation.