Keywords are the predefined and specific reserved words, which hold special meaning. Keywords help in defining any statement in the program. When it comes to C language it consists of 32 keywords. Some of the examples of keywords are: double, int, auto, char, break, and more.
What is an Identifier?
A particular name generated by the programmer to define a variable, structure, class, or function is called an identifier. It is important to suggest some understandable names to the identifiers to get the code quickly readable.
Difference between Keyword and Identifier
S.No. Keyword Identifier
1 Keywords are predefined and specific reserved words, which hold special meaning. Keywords help in defining any statement in the program. A particular name generated by the programmer to define a variable, structure, class, or function is called an identifier.
2 A keyword begins with lowercase. In the identifier, the first character may begin with uppercase, lowercase or underscores.
3 It defines the type of entity. It classifies the name of the entity.
4 It can only have alphabetical characters. It can have numbers, alphabetical characters, and underscores.
5 It should be lowercase. It can be both upper and lowercase.
6 It helps in defining a particular property that subsists in a computer language. It helps in locating the name of the entity.
7 double, int, auto, char, break, and more are examples of keywords. Test, count1, high_speed, etc are examples of identifiers.
Identifier is one of the tokens which are used in C programming language. It is a name which is used to identify the variables, constants, functions, arrays, and also user-defined data.
We cannot use keywords as identifiers because keywords are reserved for special use. Once declared, we can use the identifier in later program statements which refers to the associated value.
The special kind of identifier is known as a statement label and it can be used in goto statements.
Rules
The rules for naming identifiers are as follows −
Identifier names are unique.
Cannot use a keyword as identifiers.
Identifier has to begin with a letter or underscore (_).
It should not contain white space.
Special characters are not allowed.
Identifiers can consist of only letters, digits, or underscore.
Only 31 characters are significant.
They are case sensitive.
..
“For every minute you are angry you lose sixty seconds of happiness."
Answers & Comments
Verified answer
Keywords are the predefined and specific reserved words, which hold special meaning. Keywords help in defining any statement in the program. When it comes to C language it consists of 32 keywords. Some of the examples of keywords are: double, int, auto, char, break, and more.
What is an Identifier?
A particular name generated by the programmer to define a variable, structure, class, or function is called an identifier. It is important to suggest some understandable names to the identifiers to get the code quickly readable.
Difference between Keyword and Identifier
S.No. Keyword Identifier
1 Keywords are predefined and specific reserved words, which hold special meaning. Keywords help in defining any statement in the program. A particular name generated by the programmer to define a variable, structure, class, or function is called an identifier.
2 A keyword begins with lowercase. In the identifier, the first character may begin with uppercase, lowercase or underscores.
3 It defines the type of entity. It classifies the name of the entity.
4 It can only have alphabetical characters. It can have numbers, alphabetical characters, and underscores.
5 It should be lowercase. It can be both upper and lowercase.
6 It helps in defining a particular property that subsists in a computer language. It helps in locating the name of the entity.
7 double, int, auto, char, break, and more are examples of keywords. Test, count1, high_speed, etc are examples of identifiers.
Identifier is one of the tokens which are used in C programming language. It is a name which is used to identify the variables, constants, functions, arrays, and also user-defined data.
We cannot use keywords as identifiers because keywords are reserved for special use. Once declared, we can use the identifier in later program statements which refers to the associated value.
The special kind of identifier is known as a statement label and it can be used in goto statements.
Rules
The rules for naming identifiers are as follows −
Identifier names are unique.
Cannot use a keyword as identifiers.
Identifier has to begin with a letter or underscore (_).
It should not contain white space.
Special characters are not allowed.
Identifiers can consist of only letters, digits, or underscore.
Only 31 characters are significant.
They are case sensitive.
..
“For every minute you are angry you lose sixty seconds of happiness."
..
hope it may help you dear
.
thanks