Professional Documents
Culture Documents
of votes: 3)
Part Two
Author: Icydemon
Submitted: 13-Feb-2008 16:22:17
The Variable
Types of Variables
There are three major variable types: numeric variables (which are used to
store numbers), alphanumeric variables (which are used to store
characters, numbers and symbols in a string format), and logical variables
(which store logical values, like true or false.
Declaring a Variable
As was said earlier, how a variable is declared depends on the language that
you use. In our examples from now on we will use the C style, since most
languages inherit C's structure and syntax. To declare in C we do the
following:
int myVariable;
This declares an integer variable named myVariable. C variables are case-
sensitive; myVariable, myvariable and mYvArIaBlE are not the same
variable. However, C standards for readability dictate that we capitalize the
first letter of each word.