Pascal Variables
Variables store values and information. They allow programs to perform
calculations and store data for later retrieval. Variables store numbers, names,
text messages, etc.
Pascal supports FOUR standard variable types, which are
- integer
- char
- boolean
- real
integer
Integer variables store whole numbers, ie, no decimal places. Examples of
integer variables are,
34 6458 -90 0 1112
char
Character variables hold any valid character which is typed from the keyboard,
ie digits, letters, punctuation, special symbols etc. Examples of characters
are,
XYZ 0ABC RANJAN_SAID.GO;AWAY [ ] { } = + \ | % ( ) * $
boolean
Boolean variables, also called logical variables, can only have one of two
possible states, true or false.
real
Real variables are positive or negative numbers which include decimal places.
Examples are,
34.265 -3.55 0.0 35.997E+11
Here, the symbol E stands for 'times 10 to the power of'
Types integer, char and boolean are called ORDINAL types