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) Perfect Final

This final code challenge will require you to use almost everything we've covered in this course. You’ll write a program

please help

Program.cs
using System;

namespace Treehouse.CodeChallenges
{
    class Program
    {
        static void Main()
        {
            Console.Write("Enter the number of times to print \"Yay!\": ");
            string numofTimes= Console.ReadLine();
            int num =int.Parse(numofTimes);
            for( i=0; i<num; i++)
        }
        {
                 Console.WriteLine("\"Yay!\"");



        }
    }
}

1 Answer

Steven Parker
Steven Parker
231,269 Points

You have a misplaced brace.

It's the closing brace ("}") on the line following the for statement — it should go below the WriteLine instead. If you check the compiler errors (using the "preview" button), you'll see it referred to as an "unexpected symbol".

You also forgot to declare the variable "i" in that for statement. Just put the keyword "var" in front of where it first appears on the line.