A student types the numbers from 1 to 500 on a computer keyboard. How many…

2022

A student types the numbers from 1 to 500 on a computer keyboard. How many times in total will he press the keys?

  1. A.

    526

  2. B.

    603

  3. C.

    1402

  4. D.

    1392

Attempted by 9 students.

Show answer & explanation

Correct answer: D

Concept

Counting total key presses means counting the total number of digits written when listing the whole numbers over a range. Each number contributes as many key presses as it has digits, so the work is grouped by digit-length: 1-digit numbers (1–9), 2-digit numbers (10–99), and 3-digit numbers (100 onwards). Total presses = sum over bands of (count of numbers in a band × digits per number in that band).

Application

  1. 1-digit band (1 to 9): there are 9 numbers, each 1 digit → 9 × 1 = 9 presses.

  2. 2-digit band (10 to 99): there are 90 numbers, each 2 digits → 90 × 2 = 180 presses.

  3. 3-digit band (100 to 500): there are 401 numbers, each 3 digits → 401 × 3 = 1203 presses.

  4. Add the bands: 9 + 180 + 1203 = 1392 presses.

Cross-check

Split the last band the other way: 100 to 499 is 400 numbers × 3 = 1200, and 500 alone adds 3, giving 1203 again. So 9 + 180 + 1200 + 3 = 1392, confirming the count of key presses needed to type every number from 1 to 500.

Explore the full course: Niacl Ao It Specialist