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 trialbehar
10,799 PointsWhat am i missing?
What am i missing here'?
string language = Console.ReadLine();
if (launguage == "C#");
{
console.WriteLine("C# Rocks!");
}
1 Answer
andren
28,558 PointsYour code is close, but there are three issues:
- You have misspelled language as launguage in your
if
statement. - You have a semicolon after the condition of your
if
statement, which causes theif
statement to be terminated right away. - 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.