O'Reilly logo

Start Here!™ Fundamentals of Microsoft® .NET Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators

Almost all programming languages use the same symbols for the most common operators. For example, + means addition, – means subtraction, and / means division.

A few differences, however, and different languages may also give slightly different precedence to the various operators. The following section explains how you can use parentheses to override the normal precedence and change the evaluation order. The sections after that summarize the most common operators used in C# and Visual Basic.

Parentheses

After you study the precedence tables that follow, you can come up with some interesting puzzles in figuring out how to evaluate expressions. For example, you can try to figure out the value of the following expression:

1 + 2 ^ 3 * 4 / 2

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required