PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 1
Data and Its Type
& %
Lect 3 Goutam Biswas
, ' $
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 2
Name and Location
• Data is stored in the memory.
• In a machine instruction, a memory location
is identified by its address.
• In a high-level languagea a location is
identified with a name, called a variable. A
variable is bound to a memory location.
a Imperative programming language e.g. Fortran, Algol, Pascal, C, C++ etc.
& %
Lect 3 Goutam Biswas
, ' $
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 3
Name and Location
• Data can be read from a memory location
and a memory location can also be updated.
• This facility is made available in a high-level
language by using a variable as an expression
and making an assignment to a variable.
& %
Lect 3 Goutam Biswas
, ' $
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 4
Types of Data
• There can be data of many different types
e.g. whole numbers, integers, rational
numbers, real numbers, complex numbers,
vectors, matrices, characters etc.
• In the machine hardware everything is
encoded as strings of binary digits (0 and 1)
of finite lengths.
& %
Lect 3 Goutam Biswas