0% found this document useful (0 votes)
23 views14 pages

Data Types

Uploaded by

Reviewer Note
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views14 pages

Data Types

Uploaded by

Reviewer Note
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

RECOGNIZING

DATA TYPES
DATA TYPE
o It describes a specific data that can be stored in a
variable.

o Defines how the data of a variable will be used by


the program
CHARACTER (char)
A data type that holds and displays unit of information
equivalent to one alphabetic letter or symbol.

Examples:

‘J’, ‘R’, ‘U’

‘N’, ‘C’, ‘R’


STRING
It refers to a collection or series of characters which
represents name of an entity

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:

0.95 70.00 .05

10.5 1.75 90.6


BOOLEAN
It contains values with two options.

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).

o It can hold even the smallest and largest


approximation of a real number .
SHORT
An integer which can hold a 4 byte place
value (32 bits or 232 place value).

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.

3. The name cannot contain more than 255 characters.


4. The name cannot be a reserved word.

Reserved words are English words used as codes in C++ programming.

Ex. main, else, float, if, string


EXAMPLES OF DECLARING A VARIABLE

int grade;

Int quiz1, quiz2, quiz3;

string username;

float average;

You might also like