Data type

(a) What is a Data type? List its various types in C.

The data type defines a set of values and a set of operations on those values. The data and its types are defined before designing the actual program that is used to process the data. The type of each data value is identified at the beginnings of program design.

C language provides the following data types:

  • int: To store numeric values
  • float: To store real values
  • double: To store large real values
  • char: To store character values

(b) What are the character constants? Give examples.

Any character written within single quotation mark is known as character constant. All alphabetic characters, digits and special symbols can be used as character constants. The maximum length of a character constant is 1 character.

Examples of character constants are as follows:
‘A’, ‘b’, ‘3’, ‘@’, ‘=’, ‘$’.