Data Types

What are Variables?

Data is stored in the computer‘s memory RAM) while a program is running and Variables are named areas in computer memory where the processor stores values. Each variable is given a name which allows the computer to use the data in that location. The value stored in a variable may change as the program runs but the name of the variable always stays the same.

Programs will use variables to store values whilst executing programs.

To store two numbers, two variables would be required, which could be named as number1 and number2. To store two names, two variables would be required e.g. name1 and name2.

Data Types

Each variable must be given a data type as shown below.