9. Crunching the Numbers—Letting C Handle Math for You

In This Chapter

Handling basic arithmetic

Understanding order of operators

Breaking the rules with parentheses

Using assignments everywhere

Many people still break out in a cold sweat when they are told that they will have to do some math. Luckily, computers don’t mind math, and as long as you enter the numbers correctly, your C program will always do your math right with the use of operators. The term operators might conjure images of the ladies that used to help with long-distance phone calls, but we aren’t discussing those. These are C operators, which let you do math. You don’t have to be a math wizard to write programs that use math operators.

Not only should you learn to recognize ...

Get C Programming Absolute Beginner’s Guide, Third Edition now with O’Reilly online learning.

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