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

Saitluangpuia Sailo
Saitluangpuia Sailo
3,517 Points

error

string firstName = Console.ReadLine(); Console.Writeline("Firstname is " + firstname);

this challenge is to accept input from user and print the the input...whats wrong with this?

CodeChallenge.cs
string firstName = Console.ReadLine();
Console.WriteLIne("firstname = " + firstName);

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're really close here! First, you're doing something a little unexpected by passing in the "first name = ". It doesn't want you to do that and will cause the challenge to fail. It only wants you to pass in the firstName variable and nothing else.

The reason it's not compiling is that you've misspelled WriteLine. In your version you have a capital I after the capital L. C# does not understand what you're trying to do and will fail to compile. Remember, just about everything in programming is case-sensitive.

After fixing these two issues in your code, it passes the challenge! I think you can get it with these hints, but please let me know if you're still stuck! :sparkles: