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 trialMichael North
2,561 PointsUnexpected symbol '{'
between lines 14 and 12 it tells me that there is an unexpected symbol '{'
using System;
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Console.Write("Enter the number of times to print \"Yay!\": ");
string entry = Console.ReadLine();
int times = int.Parse(entry);
While(entry > 0)
{
Console.WriteLine("Yay!");
}
}
}
}
1 Answer
Denny Scott
16,092 PointsYour while
loop has a capital w. while
is a keyword in c#, that expects curly braces to follow. On the other hand, While isn't understood by the interpreter, so the interpreter doesn't understand why there are curly braces following a random word. You should find by switching to a lower case w you will get by this error case. Hope that helps you :).
Michael North
2,561 PointsMichael North
2,561 PointsThank you very much for clearing things up, and for responding so quickly