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 Formatting Output

Declare a variable using a string Console.Readline(). Am I missing something, can't seem to do it right?

Help

CodeChallenge.cs
Console.Readline=firstname"Jeremy";
Benny Ogidan
Benny Ogidan
17,948 Points

string firstname = "Jeremy"; Console.Readline(firstname);

Steven Parker
Steven Parker
231,269 Points

That's not quite it either. See my hints.

1 Answer

Steven Parker
Steven Parker
231,269 Points

Declare the variable first, using "var" or "string" and then the name, follow with the equal-sign and then call the function. Remember to put parentheses () after the function name. Finally end the statement with a semicolon. You won't need an actual name here, it will be input by the user.

Remember to spell "firstName" with a capital "N" and "ReadLine" with capital "L".