DATA TYPES , CONSTANT MACRO AND IDENTIFIERS
The set of values and set of operations allowed to performed by a variable is called data type.It also declares the maximum and minimum range of values will be store in variable.
Types
● Int
● float
● double
● char
Integer: It takes 2 bytes in memory location.
Maximum range 2+15 (32767)
Minimum range 2-15 (-32768)
Types of Integer
● Short int
● Signed int
● un signed int
● long int
● un signed long int
Short int,signed int,unsigned int take 2 bytes in memory location and long int,unsigned long int take 4 bytes in memory.
Float
Only use to describe numbers with decimal points or fractional numbers.Always take memory location of 4 bytes.Give result up to six digit of precision after decimal point.
Maximum range 3.4×1038
Minimum range 3.4×10ˉ38
Double
It is a floating type variable with double precision,type double occupies eight bytes.Give result up to 15 digits.Maximum range 1.7×10308
Minimum range 1.7×10ˉ308
Long Double
It refers to the floating point data type that is often more precise than double data type. Give result up to 19 digits. Always take memory of 10 bytes.
Maximum range 1.7×10 4932
Minimum range 1.7×10 ˉ4932
Char
Only use to declare single character value written in single quotation mark.Take memory of 1 byte.
signed -128 to 127 in ASCI
unsigned 0 to 255
Example 'A', '1', '$'
Constant Macro:
#define
With #symbol and "define" keyword we declare a value assign to variable is called constant macro.We use variable in developing the program whose value automatically replace during compile time.
Syntax
#define variable name = value
Example
#define pie=3.14159
Identifiers
All the names use in a language to make a program is called identifiers.It consists of constants,variables,functions,datatypes and labels.Maximum 31 characters are allowed to write the name of identifiers.
Example include, name, main(), printf(), etc
Types of Identifiers
The names define by the language and names which have predefined meaning are called standard identifier. If user attempts to change the meaning of any standard identifier than it cannot be used for original purpose. Standard Identifier cannot access memory location.
Example: main (),print f(),include etc..
User Identifier:
The names define by the user and don’t have any predefined meaning are called user identifiers. It is user to access memory location to hold data and its computational results. User identifiers can be used for any purpose.
Example: name, roll no, address etc.
Types
- Standard data type
- User define data type
● Int
● float
● double
● char
Integer: It takes 2 bytes in memory location.
Maximum range 2+15 (32767)
Minimum range 2-15 (-32768)
Types of Integer
● Short int
● Signed int
● un signed int
● long int
● un signed long int
Short int,signed int,unsigned int take 2 bytes in memory location and long int,unsigned long int take 4 bytes in memory.
Float
Only use to describe numbers with decimal points or fractional numbers.Always take memory location of 4 bytes.Give result up to six digit of precision after decimal point.
Maximum range 3.4×1038
Minimum range 3.4×10ˉ38
Double
It is a floating type variable with double precision,type double occupies eight bytes.Give result up to 15 digits.Maximum range 1.7×10308
Minimum range 1.7×10ˉ308
Long Double
It refers to the floating point data type that is often more precise than double data type. Give result up to 19 digits. Always take memory of 10 bytes.
Maximum range 1.7×10 4932
Minimum range 1.7×10 ˉ4932
Char
Only use to declare single character value written in single quotation mark.Take memory of 1 byte.
signed -128 to 127 in ASCI
unsigned 0 to 255
Example 'A', '1', '$'
Constant Macro:
#define
With #symbol and "define" keyword we declare a value assign to variable is called constant macro.We use variable in developing the program whose value automatically replace during compile time.
Syntax
#define variable name = value
Example
#define pie=3.14159
Identifiers
All the names use in a language to make a program is called identifiers.It consists of constants,variables,functions,datatypes and labels.Maximum 31 characters are allowed to write the name of identifiers.
Example include, name, main(), printf(), etc
Types of Identifiers
- Standard Identifier
- User defined Identifier
The names define by the language and names which have predefined meaning are called standard identifier. If user attempts to change the meaning of any standard identifier than it cannot be used for original purpose. Standard Identifier cannot access memory location.
Example: main (),print f(),include etc..
User Identifier:
The names define by the user and don’t have any predefined meaning are called user identifiers. It is user to access memory location to hold data and its computational results. User identifiers can be used for any purpose.
Example: name, roll no, address etc.