C – Type Modifiers

Home/Learn C Programming/C – Type Modifiers
C – Type Modifiers 2017-08-05T14:37:21+00:00

Type modifiers :

A type modifiers alter the meaning of the base data type to yield a new type. There are four types of modifiers in C they are

  • signed
  • unsigned
  • short
  • long
  1.   Each of these type modifiers can be applied to the base type int.
  2. Type modifiers signed and unsigned can also be applied to the base type char. 
  3. In addition, long can be applied to double. 
Data type Format Memory size  

Accessibility range

 

unsigned char %c 1 Byte 0 to 255
char %c 1 Byte -128 to 127
int %d 2 Bytes -32768 to 32767
unsigned  int %u 2 Bytes 0 to 65535
long  (or)

long int

%ld 4 Bytes -2147483648 to

2147483647

unsigned long (or)

unsigned long int

%lu 4 Bytes  

0  to  4294967295

 

float %f 4 Bytes 3.4*(10 power -38) to

3.4*(10 power 38)

double %lf 8 Bytes 1.7*(10 power -308) to

1.7*(10 power 308)

long double %Lf 10 Bytes 3.4*(10 power -4932) to

1.1*(10 power 4932)

char[ ] (string) %s

 

%o      Octal Base

%x      Hexa decimal base

%p      Memory address

Prev Next