The. C Declarations 37
SUMMARY
Having studied the basics in the first chapter the reader is now exposed in the second chapter to the
additional fundamentals of C. These things are absolutely essential for writing the programs. The
reader is made aware of the following points. Readers are suggested to go through this chapter
thoroughly as the chapter contains the fundamentals and basics.
a) Different types of characters like letters, digits, white space, and special characters. Various
delimiters used with C statements, keywords and identifiers.
b) Different constants, variables, and data types.
c) Rules for defining variables and initializing them.
d) Type conversion of variable.
e) Constant and volatile variables.
EXERCISES
A) Answer the following questions.
1) What are the different data types?
2) What are the differences between signed and unsigned data types?
3) What is meant by a variable and a constant?
4) Explain different types of constants in C.
5) What are the C keywords? Elaborate them.
6) List the rules for declaring a variable.
7) What are identifiers?
8) Explain the methods for initialization of variables.
9) Explain constants and volatile variables.
10) Write about space requirement for variables of different data types.
11) What are delimiters? Explain their uses.
12) Is main a keyword? Explain.
13) List any three keywords with their use.
14) What is the difference between %f and %g control strings? Can both be used for representing
float numbers?
15) What do you mean by type conversion? Why is it necessary?
B) Select the appropriate option fo r each o f the following questions.
1) A character variable can store only
a) 1 character
b)
20 characters
c) 254 characters
d)
none of the above
C variable cannot start with
a) a number
b)
an alphabet
c) a character
d)
none of the above
A short integer variable occupies memory
a) 2 bytes
b)
4 bytes
c) 1 byte
d)
8 bytes