Data Types:
An integer is a whole number (156, 0, -52) that typically takes up 2 bytes.
Real is a number with a fractional part (1.52, 20.0) that typically takes up 4 bytes.
Char is a single ASCII character (A, b, !) that typically takes up 1 byte.
A string is a combination of characters and that takes up 1 byte per character. A substring is part of a string.
Boolean can only take the values true or false and depending on the circumstance can take up either 1 bit or 1 byte.
The most common type you need to change between would be integer and string. To do this:
Key Definitions:
A variable is a named data store that contains a value that may change during the execution of a program.
A constant is a named data store that contains a value that does not change during the execution of the program.
Always use sensible names for variables and declare all variables and constants at the beginning of a program.
Calculations:
Along with +- / * there are two other types of calculation that you need to know:
- MOD (%)→ is used to find remainders. eg/ 15 MOD 2 = 1
- DIV (\)→ integer division so that there are no decimals. eg/ 15 DIV 2 = 7
Comparison Operators:
== → equal to
!= → not equal to
< = → greater than and equal to
> = → less than and equal to
Thank you for reading and I hope this was useful.