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

steeve Francois
PLUS
steeve Francois
Courses Plus Student 572 Points

Initialize bookTitle with the title of your favorite book.

can anyone see what wrong with this?

CodeChallenge.cs
string bookTitle;
string bookTitle  = "Rythm of Life";

4 Answers

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,271 Points

william is right but the challenge isn't accepting that. to pass it, instead of making a 2nd line, just extend what you put for the first part of the challenge with the = and book name and it will go through. in other words, just submit what you posted here on the second line only.

William Schultz
William Schultz
2,926 Points

You're trying to declare the same variable twice. The second line should not have the word 'string' in front of it as you have already declared it. To initialize it, just say bookTitle = "Rythm of Life";

Bikram Perhar
Bikram Perhar
163 Points

why every time i finish both challenges it does not let me pass through and it goes back to the first question?