Module 1 - Introduction to
Computer Programming
BITS Pilani Dr. Jagat Sesh Challa
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. Jagat Sesh Dr. Rajya Dr. Tejasvi Dr. Asish
Challa, I/C Lakshmi Alladi Bera
TAs
Sakshi, Vijay Kumari, Abhishek Vyas, Arti Jha, Rakhee Gupta, Sunil K Yadav, Shivam Lahoria
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Evaluation Components
Nature of
Weightage component
Component Duration Date & Time
(%) (Close Book/ Open
Book)
Mid-Semester
90 Min. 20 TBA Closed Book
Test
Comprehensive
180 Min. 40 TBA Partly Open Book
Examination
19 June 2022
Quiz 45 Min. 10 Closed Book
(Sunday) 11 AM
Programming 24 July 2022
120 Min. 20 Open Book
Test (Sunday) 10 AM
Laboratory 120 Min.
10 -- --
Sessions each
Dept. of Computer Science & Information Systems, BITS Pilani, Pilani Campus
Make up Policy
• Makeup will be granted only for medical emergencies leading
to hospitalization (or a personal emergency of similar nature).
• The decision by the Instructor-In-Charge regarding makeups
would be final.
• Makeups are allowed for Mid Semester Test, Quiz, Lab Test
and Comprehensive Examination.
• No makeup for weekly laboratory sessions.
• Out of 11 lab sessions, 9 will be evaluative. Best 7 of 9
will be considered.
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
• Sublime text for writing programs
• Ubuntu terminal for compiling and execution
• Practicing at home – install OS or VM or WSL on your
machines for practice [DIY]
Course Website
• Nalanda – LMS of BITS Pilani
• https://nalanda-aws.bits-pilani.ac.in/
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
Cost and processor) Speed
Size
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 performs 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
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