lect3 - DS CS 11002 9 Computer Sc Engg IIT Kharagpur 6 1...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 1 & $ % Data and Its Type Lect 3 Goutam Biswas
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
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 language a 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
Image of page 2
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
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
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
Image of page 4
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 5 & $ % Types of Data In the machine a few primitive types of data are differentiated and processed by different instructions and pieces of hardware e.g. an integer data is processed in the ALU and a fractional data is processes in the FPU. Lect 3 Goutam Biswas
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 6 & $ % Types of Data This gets reflected in the built-in or primitive data types of a high level language. Modern high level languages also provide facility to construct complex data types using type constructors. Lect 3 Goutam Biswas
Image of page 6
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 7 & $ % A Few Built-in Data Types in C int float char unsigned int unsigned char long long int double Lect 3 Goutam Biswas
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 8 & $ % Simple Variable Declaration in C char upperCase, grade = ’B’; int count, index = 9; float cgpa = 9.5, interest; Lect 3 Goutam Biswas
Image of page 8
PDS: CS 11002 Computer Sc & Engg: IIT Kharagpur 9 & $ % char, int, float
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern