O'Reilly logo

C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart by Brian Overland

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

2 Decisions, Decisions

Once you know how to do input, output, and data calculations, you’re on your way to writing real C++ programs. But there’s more to programming than that. The most useful programs have behavior: the ability to respond to conditions.

In effect, computers make decisions. That’s what this chapter is all about.

We’ll start by looking at some simple programs. By the end of the chapter, you’ll have the tools to do something interesting: perform a prime-number test. For large numbers especially, that job is a difficult one for humans, but it’s perfect for a computer.

But First, a Few Words about Data Types

But before you look at computer decision-making, it’s important to understand data. Ultimately, all information on a computer ...

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