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 / else

Joel Muro
Joel Muro
2,884 Points

if objective

iknow you have to put console.write("C# Rocks!");

if(language=="C#") {

}

where do i go from here for the objective

Rob B
Rob B
11,677 Points

in between the {} is where you would put that console.write. :)

1 Answer

Steven Parker
Steven Parker
231,236 Points

Remember that C# is case-sensitive. So console.write is not the same thing as Console.Write.

Being careful with case and putting the write statement inside the braces, you'll have:

string language = Console.ReadLine();
if (language == "C#") {
  Console.Write("C# Rocks!");
}
Rob B
Rob B
11,677 Points

That too. Thanks for catching that. I've got my head buried in the CSS Selectors course at the moment.

Steven Parker
Steven Parker
231,236 Points

Remember to select a "best answer" :)