Module 1 - Introduction to
Computer Programming
Dr. Jagat Sesh Challa
BITS Pilani Dr. Amitesh Singh Rajput
Pilani Campus
Department of Computer Science & Information Systems
Module Overview
• General course information
• Objectives of the Course
• Computers and Computing
• Introduction to Programming
• The C language
• Program and Process Execution
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
BITS Pilani
Pilani Campus
General Course Information
CS F111 - Team
Instructors
Dr. Pratik Dr. Rajya Dr. Amitesh S. Dr. Jagat Sesh
Narang Lakshmi Rajput, I/C Challa
TAs
Sakshi, Vijay Kumari, Ankit Soni, Praveen Kumar, Abhishek Vyas, Neha Chaudhary
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Evaluation Components
Nature of
Weightage Date & component
Component Duration
(%) Time (Close Book/ Open
Book)
Mid-Semester Test 90 Min. 25 TBA TBA
Comprehensive
120 Min. 35 TBA TBA
Examination
Quizzes /
-- 30 TBA Open Book
Programming test
Laboratory Sessions -- 10 -- --
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Text Book and Reference Books
Text Book:
Hanly, J.R. and E.B. Koffman. Problem Solving and Program Design in C(7/e).
Pearson Education, 2013
Reference Books:
1. Patt, yale. Introduction to computing systems: from bits & gates to C
&beyond (2/e). Mcgraw hill education, 2017.
2. Forouzan, b.A. And richard F. Gilberg . computer science A structured
programming approach using C (3/e). Cengage learning, 2007
3. Gottfried, B.S. and Jitender chhabra. Programming with C (schaum's
outlines series, 3/e). Mcgraw hill education, 2017.
4. Kernighan, b.W and dennis ritchie. The C programming language (2/e).
Pearson education india, 2015.
5. Das, s. Unix: concepts and applications (4/e). Mcgraw hill education, 2017.
6. Das, Sumitabha. Computer fundamentals and C programming. New delhi,
india: mcgraw hill education. (2018)
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Laboratory Sessions & Course Website
Laboratory Sessions
• Weekly 2 hours
• Lab sessions on Ubuntu – install OS or VM or WSL on your
machines [DIY]
Course Website
• Nalanda – LMS of BITS Pilani
• [Link]
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
BITS Pilani
Pilani Campus
Course Objectives
Course Objectives
• Computer and Computing Methodologies
• Basic concepts of the C programming language
• Problem-solving through programming
• Systematic techniques and approaches for constructing
programs
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
BITS Pilani
Pilani Campus
Computers and Computing
Computer
Computer
• A device that takes data as input, does some processing and
then returns an output
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Types of Memory
Registers (inbuilt on the
processor)
Cache (inbuilt on the
Size processor) Cost and
Speed
Primary (RAM, ROM)
Secondary (HDD,
FlashMemory)
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
BITS Pilani
Pilani Campus
Introduction to Programming
What is a Program?
Program
• Collection of instructions that perform a specific task when
executed by a computer.
• Written using a Programming Language.
• Programming languages are mechanical and not natural;
hence are unambiguous.
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Levels of Programming
Languages
High Level Language
Assembly Language Ease of
understanding
Machine language
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Machine Language
• Language of the machine
• Made up of a series of binary
High Level Language
patterns
Ease of
Assembly Language understanding
• Can be run directly Machine language
• Difficult to learn
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Assembly Language
• Uses simple pneumonic
abbreviations
High Level Language
Ease of
• Unique to a specific CPU Assembly Language understanding
architecture
Machine language
• Requires assembler
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
High level Language
• English-like
• Easier
High Level Language
Ease of
Assembly Language understanding
• Requires Compiler
Machine language
• Compiler: Generates object
code
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Example
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Questions from previous class
• Which memory type among register and RAM is the fastest?
• How the assembly language is converted to machine code?
• How the high-level language is converted to machine code?
• Any two advantages and disadvantages of secondary memory?
• Secondary Memory – Magnetic Storage (HDD), Solid State
Storage (SSD, memory cards), and Optical Storage (CD, DVD)
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
BITS Pilani
Pilani Campus
The C Programming Language
The C language
• General Purpose high-level programming language
• Language is platform independent
• Closely associated with the UNIX operating system
• Most versatile as it supports direct access of memory
locations through pointers
• Compiler based language
• C programs are fastest in execution time!
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
BITS Pilani
Pilani Campus
Program and Process Execution
What happens to your program?
You write a program…
1. Where is your program saved?
2. What happens to your program when you try to compile and run it?
Before we answer the above questions let us see what is an
operating system…
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Operating System (OS)
• An OS is a layer of software interposed between the application
program and the hardware
• OS manages everything of your computer including hardware
• OS is responsible for executing your program
• A program under execution is known as a process
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Basic layout of Computer Hardware
OS
Manages
these
resources
CPU Disk
Memory (RAM)
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
What happens to your program?
Now let us answer these questions…
1. Where is your program saved?
2. What happens to your program when you try to compile and run it?
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
1. Where is your program saved?
Your program
when saved gets
stored on the
disk
Program
CPU DISK
Memory (RAM)
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
What happens to your program?
Now let us answer these questions…
1. Where is your program saved?
2. What happens to your program when you try to compile and run it?
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
2. What happens to your program
when you try to compile and run it?
• OS loads the
program into RAM
• Executes it line by
line on CPU
Program
Program Program
Program is Program
executed gets
on CPU loaded
CPU into RAM DISK
Note: Program under
execution is known as a
Memory (RAM) Process
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
BITS Pilani
Pilani Campus