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) Console I/O Variables

i dont know how to solve this

when they say declare string and varible as bookTitle

CodeChallenge.cs
string bookTitle =

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Rishab,

Task one is just asking for the variable to be declared and also states (Don’t assign it anything.). By putting the assignment operator (=) in your line of code, the compiler is looking for the assignment. So, right now, the line is incomplete and producing a syntax error.

But going back to the instructions and just declaring. For this, you have the correct words, you just need to end the line with a semicolon, like so...

string bookTitle;

That's it... a new string variable named bookTitle is now declared. The next task is where you will initialize the variable with a string using the assignment variable.

Keep coding! :dizzy: :)