COSC1101- Programming
Fundamentals
 Course Instructor: Sana Nazir
 Intro & Lecture 1
 Course Objective
This course is all about the basic programming skills. Students
will learn how to design the algorithms to solve simple problems
and then how to program the designed algorithms. Students will
study the programming constituents in C/C++ from basic to
advance level. At the end of the course, students will be able to
understand the problems and design and write appropriate
computer programs in C/C++ to solve those problems.
 Recommended books:
1. Let Us C by Yashwant Kanitkar
2. How to Program: Using C++ by Robert Lafore
3. Programming in C by Behroz A. Frouzen
4. C ++ by Dietal & Dietal
5. Object Oriented programming using C++ by Tasleem Mustfa
 How Important is it?
• Fundamental basis for all of your courses that involve
 programming throughout this degree program
• It will be very hard to compensate for it in future
• If you fail to perform well in this course, it will be very hard for
 you to go through next semesters and to finally get out with a
 degree in your hand. 
 How to Perform Well
 Revise the lecture the same day
 Complete given tasks before next lecture
 Tasks will be given at the end of every lecture
 Consult your teacher, class mates if you are unable to
 understand a concept.
Most Important Thing
 Practice
 Course Content
• Basics of Programming & Programming Languages
• Problem Solving using Algorithms
• Operators
• Decision Statement: If, If-Else, Switch, Break and
 Continue, Switch
• For Loop Structure, While and Do While Loop, Nested
 loops
• Arrays
 Course Content
• Functions
• Strings: Basics and Manipulation
• Pointers
• Structures
• Handling Files in C
 Programming Fundamentals Intro
Computer:
A computer is a programmable, multiuse machine that accepts
data, ( raw facts and figures) and process, or manipulates, it into
information.
Information:
“processed data on a computer is called information.”
 Programming
• Computers are dumb but they can do exactly what they are
 told to do
• Giving instructions to a computer to perform a task is what we
 call “programming”
• These set of instructions are called a “computer program”
• This capability of computers is what makes them so powerful
 Programming
1. What kind of instructions a computer
 can understand?
2. How can we communicate it to the
 computer?
 Looking Inside Computer  
Microprocessor- A micro-chip that can perform arithmetic
operations, Being a digital circuit, it understands only 0’s and 1’s
known as “machine language”
- It can handle only simple operations like Add, Subtract,
Multiply, Divide etc.
- It can be used in many devices, computer is just one example
 Giving Instructions to Microprocessor
- It’s very hard for human beings to remember different patterns
 of 0’s and 1’s
- It is almost impossible for a human being to write a computer
 program consisting only of 0’s and 1’s
- There was a need to define a language which is easier to
 understand and work with 
 Solution: Assembly Language
Set of short words to represent different patterns of 0’s and 1’s
- Example: ADD ⇔ 00101101
Remember: Microprocessor can only understand machine
language (0s & 1s)
- How assembly language will work then?
 Solution: Assembler
A translator to convert words into appropriate patterns of 0s &
1s
- i.e, converts series of instructions (written in assembly
 language) into machine language
  Problem with Assembly Language
- It is a low-level language more close to machine rather than
 human beings
- Human mind does not work so simply as the machine does
 it is still very different from the languages that human beings
 speak
 Solution: High Level Languages
The programming languages which are closer to human
languages and further from machine languages
Remember: Microprocessor can only understand machine
language (0s & 1s) How a high-level language will work then?
 Solution: Compiler
A translator to convert instructions written in a high-level
language to low- level language.