Answers to Chapter 7 Review Questions
||How are the following expressions evaluated in C#:|
5 + (10 * 2) = 5 + 20 = 25
(5 * 6) / 3 = 30 / 3 = 10
(12 / 4) * 6 = 3 * 6 = 18
The value of myIntVariable is incremented by one. If myIntVariable++ is part of a longer expression, this increment will take place after other operations in the expression.
The value of myIntVariable is decremented by one. If --myIntVariable is part of a longer expression this decrement will take place before other operations in the expression.
||Suppose you need to add number1 and number2 together and multiply this result by number3. The first attempt:|
number1 + number2 * number3
gave a wrong ...
Get C# Primer Plus now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.