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 trialcindy yuan
1,143 PointsNot sure what I did wrong...
Not sure if I'm missing something here, it says when 2 is entered it throws an exception....what did I miss out?
int value = int.Parse(Console.ReadLine());
if(value <0 || value >20)
{
Console.WriteLine(string.Format("You entered {0}",value));
}
else
{
throw new System.Exception("Value is outside of the range.");
}
1 Answer
KRIS NIKOLAISEN
54,971 PointsYour statements are reversed. if(value <0 || value >20) you want to throw the exception.
cindy yuan
1,143 Pointscindy yuan
1,143 PointsAww got it thank you!