2. There are various types of data that a variable may contain in a
programming language . All such types are named as data type
Derived Data
type
Data Types in
c
Primary Data
Types
User
Defined
Data Type
3. Data Types in c
Primary Data Types
User
Defined
Data
types
Derive
d Data
types
Class
Stucure
Union
Array
Function
Pointer
4. Primary Data Types
Integral
type Void
Floating
Point
TYpe
Integer Characte
r
Signed Unsigne
d
Int
Short int
Long int
Unsigned int
Unsigned short
int
Unsigned long
int
Float
Double
Long double
Char
Signed char
Unsigned char
5. Integer Type
Integer are those nos with a range of values supported by a particular machine. Generaly integer occupy one
word of storage.The size of an integer that can be stored depends on the computer.
Integer are of two types 1)signed 2)unsigned
• Short int takes two bytes of memory and long int takes four bytes of the main memory of a computer.
• If we want to declare an integer variable to be non-negative only the use the unsigned
Like unsigned int k, unsigned short m, unsigned long n
Floating point type
Floating point means real nos. Floating point nos. are defined by keyword float. Real nos are stored in 32 bits
with 6 digits precision.The double data type nos uses 64 bits with a precision of 14 digits.
Character type
Characters are usually stored in 8 bits of internal storage.Unsigned char have values between 0 to 255 and
signed char have values from -128 to 127
6. • Using scanf function we can given a values to variables
• The general format of scanf function is
Scanf(“control string”,&variable1,,&varable2…….);
Or scanf(“%f%d%c”,&a,&b,&c);