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) Perform Converting Strings to Integers

int.parse

im stuck. can someone help please

CodeChallenge.cs
string heightInput = "168";

int height = int.Parse(heightInput);

Console.WriteLine(height);

Console.WriteLine(height + 10);

can someone help please

Allan Clark
Allan Clark
10,810 Points

get rid of your console.writelines and change it to manipulating the variable.

add 10 the the variable and save it to the variable. This can be done with the += operator. If you are having issues with it please post your code or specific question you are having.

1 Answer

Allan Clark
Allan Clark
10,810 Points

The instructions for the challenge just involve manipulating the variable, you do not need to worry about displaying it to the console. you should be able to accomplish this with the += operator.

thanks. but im yet to know anything about +=operator can you help further