... using namespace std;

which enables a program to use all the names in any standard C++ header (such as <iostream>) that a program might include. From this point forward in the book, we’ll use the preceding directive in our programs.2

Variable Declarations and Reading the Inputs from the User

Lines 12–13

int number1{0}; // first integer to compare (initialized to 0)
int number2{0}; // second integer to compare (initialized to 0)

declare the variables used in the program and initialize them to 0.

Line 16

cin >> number1 >> number2; // read two integers from user

uses cascaded stream extraction operations to input two integers. Recall that we’re ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.