Data Types
Data Types
DATA TYPES
DATA TYPE
o It describes a specific data that can be stored in a
variable.
Examples:
Examples
“JRU”
“ICTS112”
INTEGER (int)
A data type that has a value of real number or whole
number.
Examples:
101 90 1919
75 60 120
FLOAT
A data type which recognizes decimals or fractions of
numbers
Examples:
Example:
TRUE or FALSE
SINGLE
A type of declaration for floating numbers
(numbers with decimals) which stores 4-byte
decimal spaces (32 bits or 232).
DOUBLE
o A type of declaration for floating numbers
(numbers with decimals) which stores 8-byte
decimal spaces (64 bits or 264).
Range:
-32,768 to 32,768
LONG
An integer which can hold an 8 byte place value
(64 bits or 264 place value).
Range:
-263 to 263
VARIABLES AND CONSTANTS
RULES FOR NAMING A VARIABLE
1. The name must begin with a letter
2. The name must contain only letters, numbers and the underscore
characters.
int grade;
string username;
float average;