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 trialali raafat
444 Pointscan anyone help me
i am stuck at this part
string heightInput = "168";
int height = int.Parse(heightInput);
10 + heigth = height;
1 Answer
andren
28,558 PointsYou have the assignment backwards, in programming you need to have the variable you are assigning a value to on the left side of the equal sign, and the value you want to assign on the right side. Like this:
height = 10 + height;
It's also worth noting that when you want to set something equal to itself plus something else there is a shortcut in the form of the += operator, using that you can shorten the code to this:
height += 10;
Either way will work for this task but it's worth keeping that shortcut in mind since it is shorter and more convenient, and you will see it quite often in other developer's code.