Identifiers used In C
A c program consists of two types of elements, user defined and pre-defined.identifier is nothing but a name given to those elements. An identifier is a word used by programmer to name a variable,function or label.identifiers consists of letters and digits,in any order , except that the first character must be a letter.Both upper and lowercase letters can be used.
Identifiers are:-
1. Keywords.
2. Variables.
3. Constants.
4. Numbers.
5. Data types
- keywords :-
Keywords are nothing but system defined identifiers. Keywords are reserved words of the language.they have specific meaning in the language and cannot be used by the programmer as variable or constant names.
c language specifies 32 keywords and other reserved keywords. Keywords are listed below :
auto
|
If
|
return
|
continue
|
case
|
const
|
new
|
else
|
extern
|
struct
|
static
|
char
|
break
|
long
|
long
|
int
|
double
|
goto
|
while
|
typedef
|
Float
|
void
|
switch
|
for
|
unsigned
|
default
|
enum
|
register
|
do
|
sizeof
|
volatile
|
floatn
|
union
|
2. variable :-
A variable is nothing but a user defined element.a variable is a name that represents a memory location that can store a value.a variable is used to represent a numerical value or a character or a constant.the data(value) must be assigned to the variable in the program.rules for variable formation are as :
Ø Keywords of c cannot be used as variable name.
Ø A digit (0-9) may not start a variable.
Ø Variable name must be of maximum 8 character in length.
Ø It should not contain (comma) ’ , ’ or space in name.
3. constants :-
There are four types of constants in c.they are :-
Ø Integer constants.
Ø Floating-point constants.
Ø Character constants.
Ø String constants.
Integer and floating-point constants are also referred as numeric-type constants because they represent numbers.
4. numbers :-
Numbers are further divided into two types :-
Ø Whole numbers (integer).
Ø Real numbers(float).
Whole numbers :-
A number which does not contain decimal point is known as whole number.c defines two type of whole numbers depending upon the they store they are - int and long.
Real numbers :-
A number which contain decimal point ,is known as real numbers. C defines two basic types real numbers depending upon the range of number they store. They store- float and double.
5. Data types :-
We know the values (data), which will be given by user, will be stored into a memory and will be given a name which is known as variable.for every variable, it reserve certain amount of memory. But two question are arising :-
Ø How much amount of memory?
Ø What will be the values?
Data types with their size and range are listed below :
Data type
|
Size in bytes
|
Range
|
int
|
2
|
-32768 to 32767
|
float
|
4
|
1.2E-38 to 3.4E+38
|
long
|
4
|
-9223372036854775808 to 9223372036854775807
|
Double
|
8
|
2.3E-308 to 1.7E+308
|
char
|
1
|
-128 to 127 or 0 to 255
|
Long double
|
10
|
3.4E-4932 to 1.1E+4932
|
short
|
2
|
-32,768 to 32,767
|
So do subscribe: - You Tube Channel
Buy T-Shirts Here :
Thank You.
Information collected by
Dk45516
👍
ReplyDelete