O'Reilly logo

C Programming Absolute Beginner’s Guide, Third Edition by Dean Miller, Greg Perry

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

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 ...

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