# 1 - The way of the program

{% embed url="https://www.youtube.com/watch?v=kgEP202a2MU" %}

## What is a program?

A **program** is a sequence of instructions that specifies how to perform a computation. The computation might be something mathematical, such as solving a system of equations or finding the roots of a polynomial, but it can also be a symbolic computation, such as searching and replacing text in a document or (strangely enough) compiling a program.

The details look different in different languages, but a few basic instructions appear in just about every language:

* **Input:** Get data from the keyboard, a file, or some other device.
* **Output:** Display data on the screen or send data to a file or other device.
* **Math:** Perform basic mathematical operations like addition and multiplication.
* **conditional execution:** Check for certain conditions and execute the appropriate sequence of statements.
* **repetition:** Perform some action repeatedly, usually with some variation.

Believe it or not, that's pretty much all there is to it. Every program you've ever used, no matter how complicated, is made up of instructions that look pretty much like these. So you can think of programming as the process of breaking a large, complex task into smaller and smaller subtasks until the subtasks are simple enough to be performed with one of these basic instructions. That may be a little vague, but we will come back to this topic when we talk about **algorithms**.
