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

didn't understand!! i cant understand what the quotation required!!

i wrote the statment in two ways : 1) Console.WriteLine (firstName +rocks!+); 2) Console.WriteLine (firstName "+rocks!+"); 3) Console.WriteLine ("firstName""+rocks!+")

but non of these works!!

CodeChallenge.cs
string firstName + rocks! = Console.ReadLine();
Console.WriteLine(firstName + rocks!);
Karlijn Willems
Karlijn Willems
9,961 Points

Hello Ahmed,

You are almost there!

string firstName + rocks! = Console.ReadLine(); is not the right way to initiate your variable. The compiler won't understand the part: firstName + rocks! because of the spaces in between the words.

First initiate your variable firstName. (so delete + rocks!). Then when writing it to the screen use the variable firstName you have inititated and the string "rocks!"). When writing text as a string always use the quotation marks.

good luck! Hope this helps. =)