January 2014
Intermediate to advanced
736 pages
70h 43m
English
The variable declaration statements in lines 13–15 declare that variables number1, number2 and sum hold data of type int—that is, 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: Actual int values may not contain commas.]
Other data types include float and double, for holding real numbers (such as 3.4, 0.0 and –11.19), and char, for holding character data. Variables of type char represent individual characters, such as an uppercase letter (e.g., A), a digit (e.g., 7), a special character (e.g., * or %) or an escape sequence (e.g., the newline character, \n). The types int, float, double ...
Read now
Unlock full access