Arithmetic Operations - Order of Precedence

Arithmetic Operations - Order of Precedence - 5 2 29 Mod 55...

This preview shows pages 1–2. Sign up to view the full content.

VISUAL BASIC Arithmetic Operators Order of Precedence: ( ) Parentheses [always done in pairs] ^ Exponentiation - Negation * / Multiplication Division [have equal precedence] \ Integer Division Mod Modulo + - Addition Subtraction [have equal precedence] Examples: 16 = 2 ^ 4 25 = 5 ^ 2 204 = 3 * 17 *4 4.25 = 17 / 4 10.333 = 31 / 3 30 = 20 / 4 * 6 13.333 = 20 / 6 * 4 40 = 60 / 3 * 2 10 = 60 / ( 3 * 2 ) 27.5 = 11 * 5 / 2 300 = 3 * 10 ^ 2 4 = 17 \ 4 12 = 37 \ 3 12 = 36 \ 3 0 = 2 \ 3 1 = 19 \ 12 2 = 37 \ 3 \ 5 1 = 17 Mod 4 1 = 37 Mod 3 0 = 36 Mod 3 2 = 2 Mod 3 7 = 19 Mod 12 2 = 19 Mod 12 Mod 5 3 = 57 \ 5 Mod 4 2 = 67 \ 10 Mod 4 1 = 29 Mod 10 \ 4 0 = 18 Mod 14 \ 4 30 = ( 20 \ 3 ) * 5 1 = 20 \ 3 * 5 6 = 4 + 7 – 5 2 = 4 – 7 + 5 -8 = 4 – ( 7 + 5 ) -31 = 4 – 7 * 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document