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 trialultan gannon
5,876 Pointsif countString !/2? or if countString 1=int?
?
using System;
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Console.Write("Enter the number of times to print \"Yay!\": ");
var countString = Console.ReadLine();
int count;
Int32.TryParse(countString, out count);
while (count > 0)
{ Console.Write("Yay!");
count--;
}
if countString !/2
{
}
}
}
1 Answer
Steven Parker
231,269 PointsYou didn't mention which task you were on.
But if you remove these two lines, your code will pass task 1:
if countString !/2
{
I'm not sure what you were attempting to do with these lines, but they are not proper C# syntax and don't seem to be related to the challenge requirements for the later tasks.