Data Types PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Data Types in C

A) Primary Data types:

B)Derived Data Types:


e.g: Array pointer, array, structure, union

Primary Data Types

S Type Format Size Range Example


r Specifier
1 Character or %c 1 byte -128 to 127 or 0 to 255 char a,b,c;
Signed
Character
2 Unsigned %c 1 byte 0 to 255 unsigned char a,b,c;
character
3 Short Integer %d 2 byte -32,768 to 32767 short a;
4 Int or signed int %d 2/4 bytes -32,768 to 32767 (for 2 int a,sum; / signed int
bytes) a,sum;
5 Unsigned int %u 2/4 byes 0 to 65535 (2 bytes) unsigned int a,b,sum;
6 Long Integer %l 8 bytes long m,n;
5 Float %f 4 bytes 3.4E-38 to 3.4E+38 float a,b;
6 Double %lf 8 bytes 1.7E-308 to 1.7E+308 doule m,n;
7 Long double %LF 10 bytes 3.4E-4932 to long doulbe m,n;
1.1E+4932
Rules For Constructing VARIABLE Names

1. A variable name is any comination of 1 to 31 aplhabets, digits or underscore. (Depend on


complier, some may allow up to 247 character)
2. The first character in the variable name must be an aplabet orunderscore.
3. No commas or blanks are allowd within a variable name.
4. No special symbol other than an underscore can be used in variable name.

Keywords in C

You might also like