1.4 C-Tokens, Data Types (Size and Range), Type Conversion
1.4 C-Tokens, Data Types (Size and Range), Type Conversion
Keywords:
Keywords :
Have a predefined meaning and these meanings cannot be changed.
All keywords must be written in small letters.
Identifiers :
names of variables, functions, structures, unions, macros, labels, arrays etc.,
Rules for define identifiers :
a) First character must be alphabetic character or under score
b) Second character onwards alphabetic character of digit or under score.
c) First 63 characters of an identifier are significant.
d) Cannot duplicate a key word.
e) May not have a space or any other special symbol except under score.
f) C – language is Case-sensitive.
Operators :
a symbol, which indicates an operation to be performed. Operators are
used to manipulate data in program.
Delimiters :
Language Pattern of C-language uses special kind of symbols
: colon, used for labels
; semicolon terminates statement
() parameter list
[] array declaration and subscript
{} block statement
# hash for preprocessor directive
, comma variable separator
unsigned char %c
unsigned int %u
int %d
short int %d
Float %f
Double %lf
2 0 to 65535
unsigned int %u
4 0 to 4,294,967,295
2 -32768 to +32767
signed int %d
4 -2,147,483,648 to +2,147,483,647
1 -128 to +127
short int %d
2 -32768 to +32767
long int 4 -2,147,483,648 to +2,147,483,647 %ld
long long 8 -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 %lld
INT_MAX
INT_MIN
UINT_MAX
SHRT_MIN
SHRT_MAX
USHRT_MAX
LONG_MAX
LONG_MIN
ULONG_MAX
FLT_MAX
FLT_MIN
DBL_MAX
DBL_MIN
FLT_MAX: 3.402823e+038
FLT_MIN: 1.175494e-038
DBL_MAX: 1.797693e+308
DBL_MIN: 2.225074e-308
lDBL_MAX: 3.205284e-317
LDBL_MIN: 3.205284e-317
Note:
The final result of an expression is Final result will be float
convereted to the type of variable on LHS since y is float
of assignment operator.
float /int=float
int/ float =float
float/float=float