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) Perform if

What am i missing?

What am i missing here'?

CodeChallenge.cs
string language = Console.ReadLine();
if (launguage == "C#");
{
    console.WriteLine("C# Rocks!");
}

1 Answer

andren
andren
28,558 Points

Your code is close, but there are three issues:

  1. You have misspelled language as launguage in your if statement.
  2. You have a semicolon after the condition of your if statement, which causes the if statement to be terminated right away.
  3. You have written console instead of Console inside of the if statement. Since C# is case-sensitive it does not consider those two words to be the same thing.

If you fix all of those issues like this:

string language = Console.ReadLine();
if (language == "C#") // launguage replaced with language and removed semicolon
{
    Console.WriteLine("C# Rocks!"); // console replaced with Console
}

Then your code will work.