1.1-Introductie-Programmeren

Reaching limits

Difficulty: Filled Filled Outlined

Variables cannot store infinite values. In this exercise you’ll explore the limit of the integer data type.

Create a program that prompts you for an integer. After entry, the value of the integer is multiplied by 1,000,000 (one million) and printed out again. Once you have created this program, experiment with the following values:

Discover what the maximum value of an integer typed variable is (and try to explain what you see).

Example

Example