February 2014
Beginner
1248 pages
62h 25m
English
The variable declaration statements in lines 13–15
int number1; // first number to addint number2; // second number to addint sum; // sum of number1 and number2
declare that variables number1, number2 and sum hold data of type int—they can hold integer values (whole numbers such as 72, -1127 and 0). These variables are not yet initialized. The range of values for an int is –2,147,483,648 to +2,147,483,647. [Note: The int values you use in a program may not contain commas.]
Some other types of data are float and double, for holding real numbers, and char, for holding character data. Real numbers contain decimal points, such as in 3.4, 0.0 and -11.19. Variables of type ...
Read now
Unlock full access