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

George Gregorczyk
George Gregorczyk
3,028 Points

I do not know how to solve this question

I get errors and need the right code.

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

}

1 Answer

Ben Reynolds
Ben Reynolds
35,170 Points
string language = Console.ReadLine("C# Rocks!");
language = C#;   // These two lines can be deleted. 
language == C#; // The exercise will submit its own value for language when it tests your code
if (language == C#) // We're checking for a string value here so you'll need quotes
{
    Console.ReadLine ("C# Rocks!");  // We need to print to the console, not read from it. You'll need a different method than ReadLine.
}