Home > Articles > Programming > C/C++

Introduction to C++ Programming

In this chapter from the 8th edition of the text book C++ How to Program, Harvey and Paul Deitel offer five examples that demonstrate how your programs can display messages and obtain information from the user for processing.
From the author of
  • What's in a name? that which we call a rose By any other name would smell as sweet.
  • William Shakespeare
  • When faced with a decision, I always ask, "What would be the most fun?"
  • Peggy Walker
  • High thoughts must have high language.
  • Aristophanes
  • One person can make a difference and every person should try.
  • John F. Kennedy

2.1 Introduction

We now introduce C++ programming, which facilitates a disciplined approach to program design. Most of the C++ programs you'll study in this book process information and display results. In this chapter, we present five examples that demonstrate how your programs can display messages and obtain information from the user for processing. The first three examples simply display messages on the screen. The next obtains two numbers from a user, calculates their sum and displays the result. The accompanying discussion shows you how to perform arithmetic calculations and save their results for later use. The fifth example demonstrates decision-making by showing you how to compare two numbers, then display messages based on the comparison results. We analyze each program one line at a time to help you ease your way into C++ programming.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.