4. KEYWORDS
•KEYWORDS ( also known as specially reserved words)
CONVEYS A SPECIAL MEANING TO COMPILER.
• KEYWORDS are always typed in short(lower) case.
•They are reserved by the language for special purpose
and can’t be redefined(USED) as an IDENTIFIER.
6. RULES/CONVENTIONS
FOR DEFINING IDENTIFIERS
•It can contain characters(A-Z, a-z),Digits(0-9), & only
one special symbol called underscore(_).
•First letter must be a character (A-Z, a-z) or
underscore(_).
•No commas or blank spaces allowed.
•Keywords can’t be used as an identifier.
7. Q1. Find the correct identifiers out of the following, which can be used for naming Variable,
Constants or Functions in a C++ program:
For, while, INT, NeW, delete, 1stName, Add+Subtract, name1
ANS.)
For, INT, NeW, name1
EXAMPLE 2
8. Q1. (a) Write the type of C++ tokens (keywords and user defined identifiers) from the following
(i) For (ii) delete
(iii) default (iv) Value
ANS.)
For – Identifier
delete – keyword
default- Keyword
Value- Identifier
EXAMPLE 1