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 C# Syntax Hello, World!

Matthew Thomas
Matthew Thomas
2,922 Points

Maybe there's something I'm missing out on here.

I followed everything but can't get Hello to show up. Did I miss something?

Program.cs
class Program
 {
    static void Main(string[] args)
    {
        int wholeNumber = 4;
        double pi = 3.1415;
        bool status = true;
        string greeting = "hello";
        char letter = 'z';

        System.Console.WriteLine(wholeNumber.GetType());
        System.Console.WriteLine(pi.GetType());
        System.Console.WriteLine(status.GetType());
        System.Console.WriteLine(greeting.GetType());
        System.Console.WriteLine(letter.GetType());
    }
}

1 Answer

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 45,998 Points

Hey Matthew Thomas ! :wave:

Are you trying to write hello to the console? Meaning greeting's value?

If so, relating to the code you've provided above, I would try removing the GetType() call from that 2nd to last line.

System.Console.WriteLine(greeting);

and see if that displays what you're expecting.

However, for this challenge that you've posted this question to is far more simple than all of that and is simply asking for

class Program
{
    static void Main(string[] args)
    {
        System.Console.WriteLine("Hello");
    }
}