Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


What type of numbers can an integer data type store?

  1. Only positive whole numbers

  2. Only negative whole numbers

  3. Positive and negative whole numbers

  4. Decimal numbers

The correct answer is: Positive and negative whole numbers

The integer data type is designed to store whole numbers, which include both positive and negative values. This capability means that integers can represent a range of values from negative infinity to positive infinity, excluding any decimal or fractional components. Because of this, the integer data type is particularly useful for situations where whole values are necessary, such as counting items, indexing arrays, or performing discrete calculations. The other options specify either positive or negative whole numbers only or include decimal numbers, which is not characteristic of the integer data type. Thus, the ability to represent both positive and negative whole numbers encompasses the full spectrum of what integers can convey, making it the correct answer.