Tuesday, November 1, 2011

Summary of data types in C programming language

(a) We can use different variations of the primary data types, namely signed and unsigned char, long and short int, float, double and long double. There are different format specifications for all these data types when they are used in scanf( ) and printf( ) functions.
(b) The maximum value a variable can hold depends upon the number of bytes it occupies in memory.
(c) By default all the variables are signed. We can declare a variable as unsigned to accommodate greater value without increasing the bytes occupied.
(d) We can make use of proper storage classes like auto, register, static and extern to control four properties of the variable—storage, default initial value, scope and life.

No comments:

Post a Comment