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

ali raafat
ali raafat
444 Points

now i dont know what to do

i am confused i don't know what is my mistake. i converted the string and add a loop

Program.cs
using System;

namespace Treehouse.CodeChallenges
{
    class Program
    {
        static void Main()
        {
            bool keepGoing= true
           while(keepGoing)
           {
                Console.Write("Enter the number of times to print \"Yay!\": ");
                var entry = Console.ReadLine();
                 int input = int.Parse(entry);
           }



        }
    }
}

1 Answer

Steven Parker
Steven Parker
231,248 Points

Here's a few hints:

  • the loop should come after you convert the string to number
  • the loop will use the converted number (input) to determine how many times to repeat
  • since counting is involved, a for loop might be easier to use than a while loop
  • inside the loop you will print out the string "Yay!"