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#

First task of the if conditional statements on the C# basics track?

I have tried multiple times, but it won't let me complete it.

Steven Parker
Steven Parker
231,198 Points

Perhaps we can help if you include your code here so we can take a look.

Also, please provide a link to the course page you are working with.

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

I'm still new to C#, so please no judgement. Thank you

Steven Parker
Steven Parker
231,198 Points

We're all students here, you should be able to ask any genuine question here without concern for judgments. :smile:

1 Answer

Steven Parker
Steven Parker
231,198 Points

OK, here's a few hints:

  • it looks like you added an argument to the ReadLine call, but ReadLline does not take any arguments
  • since you want to test what was read, you will not want to assign something else to language
  • there's a stray equal sign ("=") between WriteLine and the parentheses holding its argument

In future, please use the instructions in the Markdown Cheatsheet (found below "Add an Answer" :arrow_heading_down:) to format your code for easy readability.

Thanks man.