Home > Articles > Programming > C/C++

Introduction to C++ Programming

  • Print
  • + Share This
In this chapter, Harvey and Paul Deitel offer five examples that demonstrate how your programs can display messages and obtain information from the user for processing.
This chapter is from the book

This chapter is from the book

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

  • + Share This
  • 🔖 Save To Your Account