C Numeric Data Types - C Data Type

C examples for Data Type:Introduction

Introduction

Keyword Variable Type Range
char Character (or string) -128 to 127
int Integer-32,768 to 32,767
short Short integer -32,768 to 32,767
short int Short integer -32,768 to 32,767
long Long integer -2,147,483,648 to 2,147,483,647
unsigned charUnsigned character 0 to 255
unsigned int Unsigned integer 0 to 65,535
unsigned short Unsigned short integer 0 to 65,535
unsigned longUnsigned long integer 0 to 4,294,967,295
floatSingle-precision floating-point +/-3.4 * 10^38 to +/-3.4 * 10 ^ -38
double Double-precision floating-point +/-1.7 * 10 ^ -308 to +/-1.7 * 10 ^ 308

In all, C has really only four types of variables:

char  
int  
float  
double  

What Signed and Unsigned Variables Can Hold

Signed Range UnsignedRange
char-128 to 127 unsigned char 0 to 255
int -32768 to 32,767 unsigned int0 to 65,535
long-2,147,483,648unsigned long 0 to 4,294,967,295 to 2,147,483,647

Related Tutorials