logo

Pearson Edexcel GCSE (9-1) Computer Science practice

An 8-bit unsigned integer can store values from 0 to 255. If a program attempts to store the value 256, what is the most likely outcome related to overflow?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Binary

Exam-style question

Try this first

An 8-bit unsigned integer can store values from 0 to 255. If a program attempts to store the value 256, what is the most likely outcome related to overflow?.

  1. A.The program will automatically switch to a 16-bit integer.
  2. B.The value will be accurately stored as 256.
  3. C.An overflow will occur, potentially storing an incorrect value like 0.
  4. D.The system will halt all operations and display an error message for 256.

Answer and explanation

Concise answer

An overflow will occur, potentially storing an incorrect value like 0.

Why this is correct

When an 8-bit unsigned integer overflows from 255, the next logical increment, 256, cannot be stored, and often wraps around to 0 or another incorrect value due to truncated bits.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions