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 trialZexiao Li
Courses Plus Student 695 PointsProgram.cs(10,12): error CS1525: Unexpected symbol `{' Compilation failed: 1 error(s), 0 warnings
I don't know what is the error, please help me pass this one!:)
using System;
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Console.Write("Enter the number of times to print \"Yay!\": ");
string num = Console.ReadLine();
int i = int.Parse(num);
While (i > 0)
{
Console.Write("Yay!");
i = i - 1;
}
}
}
}
1 Answer
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 PointsHi Zexiao Li,
You made a typo with your while loop. I must reminder you that any of the reserved c# keywords are case sensitive and must be written in lowercase in order to let the compiler know you are referring c# syntax.
So if you change While to while your code works.
Zexiao Li
Courses Plus Student 695 PointsZexiao Li
Courses Plus Student 695 PointsThank you so much for the answer!