Variable Declarations and Reading the Inputs from the User

Lines 13–14

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 initializes them to 0.

The program uses cascaded stream extraction operations (line 17) to input two integers. Remember that we’re allowed to write cin (instead of std::cin) because of line 7. First a value is read into variable number1, then a value is read into variable number2.

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.