You are on page 1of 1

Lab 3

1. What are reserved words and give five examples of reserved words in C.
Preserved words are keywords that identify language entities, such as statements, data
types and language element attributes.
Five examples of reserved words in C are ‘int’, ‘float’, ‘for’, ‘if’, ‘else’.

2. Define the term identifier.


Identifiers are known as programmer-defined words, which is to represent and
reference certain program entities, while writing a program.

3. What are the rules to construct identifiers?


1. Identifiers can consist of the Capital letters A to Z, the lowercase letters a to z, the
digits 0 to 9, and the underscore character ( _ ).
2. The first character must be a letter or an underscore.
3. There can be no embedded blanks.
4. Reserved words can’t be used as identifiers.
5. Identifiers are case sensitive. Therefore, Tax and tax, both valid examples of
identifiers are distinct.

4. State whether the following identifiers is valid or invalid:

 Number (valid)  name@email (invalid)


 Jan payroll (invalid)  jumbo1 (valid)
 Income_tax (valid)  Cont (valid)
 _address (valid)  Return (valid)
 12oclock (invalid)  MAIN (valid)
 %percent (invalid)  Line-1(invalid)

You might also like