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!
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
Gavin McHugh
348 PointsWhat does && mean in C#
what dose && mean in C#
1 Answer

Steven Parker
224,848 PointsIt's the logical (boolean) operator for "and". You use it to combine things which in themselves produce "true" or "false" results.
For example:
if (height > 52 && height < 80)
Console.WriteLn("Congratulations, you are allowed to ride this ride!");
For the if to be true, the height must be over 52 AND it must be less than 80.
Gavin McHugh
348 PointsGavin McHugh
348 Pointswhats the difference when using & and &&
Steven Parker
224,848 PointsSteven Parker
224,848 PointsJust one "&" is a bitwise operator. It's also called and, but instead of combining things which are either true or false, it combines the bits of two values. For example:
FYI: there are similar operators for OR: "||" for logical, and "|" for bitwise.