Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.
}