UNIT 2 2.2 Data Types Flashcards
It is whole number consisting of an optional sign (+ or -) followed by a
sequence of digit. It cannot contain commas. Variables of this type are often used for controlling
loops and conditional statements.
int variables
It consists of an optional sign (+ or -), followed by one or more digits, a decimal point,
and or one or more further digits. It occupies 4 bytes. It can include an optional exponent
ranging from 3.4 E to -38 to 3.4 E +38
float
is a special float which can store more significant digits
and have a longer exponent. It occupies 8 bytes in the memory.
It ranges from 1.7 E – 308 to 1.7 E +308
double (double precision)
It is a single letter, digit, punctuation mark or control symbol recognized by the computer. Written enclosed within single quotation marks, but literals string are enclosed in double quotation marks . A character may be
assigned an integer value between -128 and +127. Unsigned char data type may be assigned an integer value from 0 to 255.
char
valueless
void
Three uses of void:
- To declare explicitly a function as returning no value.
- To declare explicitly a function having no parameters.
- To create generic pointers.