How Does a Computer Know What to Do Next?

Imagine a computer like a robot with a list of instructions. It reads one line at a time and follows it, just like you would if someone told you what to do next. If the instruction says jump, it jumps; if it says wait, it waits. That’s how computers know what to do next, they follow a simple, step-by-step plan.

The Robot's Instructions

A computer uses something called code to tell it what to do. Code is like a recipe that the computer reads from top to bottom. Each line in the code is a small instruction, such as add 2 and 3 or print Hello World. By following these instructions one by one, the computer can do amazing things, even play your favorite video game.

Test your understanding →

Examples

  1. A computer follows instructions like a robot following a list of steps.
  2. When you press a button on your phone, it knows what to do because the code inside tells it so.
  3. Like reading a recipe one line at a time, that’s how a computer works.

See also

Discussion

Comments (0)

Categories: Technology · Computer Science· Programming· How Computers Work · Text is available under the Creative Commons Attribution-ShareAlike License.