Chapter 4: Smooth Operators

In This Chapter

check.png Performing a little arithmetic

check.png Doing some logical arithmetic

check.png Complicating matters with compound logical operators

Mathematicians create variables and manipulate them in various ways, adding them, multiplying them, and — here’s a toughie — even integrating them. Chapter 2 of this minibook describes how to declare and define variables. However, it says little about how to use variables to get anything done after you declare them. This chapter looks at the operations you can perform on variables to do some work. Operations require operators, such as +, , =, <, and &. I cover arithmetic, logical, and other types of operators in this chapter.

tip.eps Writing programs that get things done is good. You’ll never make it as a C# programmer if your programs don’t do something — unless, of course, you’re a consultant.

Performing Arithmetic

The set of arithmetic operators breaks down into several groups: the simple arithmetic operators, the assignment operators, and a set of special operators unique to programming. After you digest these, you also need to ...

Get C# 5.0 All-in-One For Dummies now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.