variables

Programs often produce results based on input from a user. To achieve this, we need somewhere to store this data. This is where we can use a variable!

A variable is a name representing a particular place in memory that has been set aside to store data. Then, when required, this data can be retrieved!

Every variable has a type. The type represents what sort of information can be stored inside of it. It tells the compiler how much memory needs to be set aside for the variable and defines what you can do with that variable!

The types are:

  • int
  • double
  • char
  • string
  • bool