CS201
CS201
Lesson 1
Introduction to Programming
🔹 What is a Program?
🔹 What is Programming?
2. Assembly Language: Uses mnemonics; easier than binary but still low-level.
🔹 Compiler vs Interpreter
Compiler: Translates the whole program into machine code before execution.
🔹 Algorithm:
🔹 Flowchart:
Visual representation of an algorithm using symbols (ovals, rectangles, diamonds,
arrows).
🔹 Errors in Programming:
2. Assembly Language
3. High-Level Languages
🔹 Language Translators
Type Description
Interpret
Translates and executes line-by-line
er
Assembl
Converts assembly code to machine code
er
🔁 Key Differences:
Portable
🔹 Disadvantages
Exam-Focused Definitions
Application softwares
System Softwere
Computer Hardwere
Device drivers: The device driver software is used to communicate between the
devices and the computer. We have monitor, keyboard and mouse attached to almost all
PC’s; if we look at the properties of these devices we will see that the operating system
has installed special software to control these devices. This piece of software is called
device driver software
Utility Software: Utility software is a program that performs a very specific task,
usually related to managing system resources.
The compilers and interpreters also belong to the System Software category.
History of C language
BCPL developed un 1967 by Martin Richards for writing OS system Soft and compilers
Ken thampson used B language to create early versions of UNIX OS system at bell lab
Dennis Ritchie developed a general purpose language called C language using diff
features of BCPL & B
. In 1989 the standard was approved. ANSI cooperated with international Standard
Organization (ISO) to standardize C worldwide.
Lecture 3 ---- How to Program
First C program
Variables
Data Types
Arithmetic Operators
precedence of Operators
Tips
# include
<iostream.h>
main()
{ cout << “virtual university of Pakistan }
We will look at this code line by line and try to understand them.
<iostream.h> This is the name of the library definition file for all Input Output Streams.
main() The name main is special, in that the main is actually the one which is run when
your program is used.
Cout: This is known as out put stream in C and C++.
There is difference in algebraic maths and C Language in maths X=2 means the value of X
is 2
Where In C X=2 mean X is variable.
Long data type have very large whole num when we want big whole num we use long
data type.
Real NUM – C provides two data type to deal with real numbers num num with decimal
pnts 1.32, 2.43---
1 float, 2 double
Lecture 4