Introduction To Programming 01
Introduction To Programming 01
Science
Subject: Introduction to Programming-C++
Lecturer: Mr. Fakhruddin
Noori
Introduction to programming
Chapter 01
Introduction to programming Chapter 01
Principles of
Learning outcomes:
Marketing
Types of Computer Languages
Comparison between Low-Level and High-Level Languages
Programming Language Characteristics
Understanding of different language translators
Program in C/C++
C/C++ programs execution
Introduction to programming Chapter 01
General Introduction
Principles
You know that computer is one ofadvanced and fast growing technologies
of the most
in the world. Marketing
It is an electronic device that can solves different problems, processes
data, stores & retrieves data and performs calculations faster than
humans.
Different computer languages are used for communication between users and
computers. It defines the rules under which programs are written to make use of
computers.
Hundreds of computer languages are in use today.
Introduction to programming Chapter 01
What is Language?
Principles of between people.
Language is a source of communication
Marketing
It is medium of Expression
What is Language?
Natural languages Principles of
These are the languages through which the human beings communicate with each other. For example: Dari,
English, Urdu, French, Pashto etc.
Marketing
Programming languages
These are the languages through which the human beings communicate with the computer. These are the
most widely used mediums between the user and the computer. Examples are C, C++, COBOL, PASCAL,
BASIC, FORTRAN etc.
Low-level Language
Principles of
It consists of two types of languages
1. Machine language Marketing
Machine Language was the first language used for computers as a source of
communication.
This is the only language which is directly understandable by the machine (computer)
and needs no translation programs (compiler, Assembler, Interpreter).
Machine language is the language of binary digits 0’s and 1’s (“0” means “OFF” and
“1” means “ON) that is why it is also called as binary language.
It is very difficult to write programs using 0’s and 1’s i.e. in machine language. Thus
machine language is totally machine dependent and is efficient for computers and
inefficient for programmers.
Introduction to programming Chapter 01
Low-level Language
Principles
Points to remember (Machine of
Language)
Marketing
The first language that was invented.
It is machine dependent.
It is also called binary language.
It is the most complicated and hard language.
A program created in machine language cannot be run on any other
computer
Machine language depends on electric pulses (i.e. on/off).
Introduction to programming Chapter 01
Low-level Language
2. ASSEMBLY LANGUAGE Principles of
Marketing
The computer professionals developed one step higher language than the machine
language which is called Assembly language.
The binary codes of machine language (0’s and 1’s) were replaced by some special codes
called mnemonics.
The programs in Assembly language are written using these mnemonic codes as: ADD for
addition, SUB for subtraction MUL for multiplication.
These mnemonics are understandable by the human but not understandable by the
machine. To make it understandable for the machine, a program called assembler is
developed its function is to translate a program written in assembly language into
machine language
Introduction to programming Chapter 01
High-level Language
Principles of
These languages are fairly machine independent and English like.
Marketing
The programmer can understand more easily and enable the programmer to
write instructions easily using English words and familiar mathematical
symbols such as if else, for, goto, +,- etc.
High-level Language
Principles
Points to remember (High-level of
Language)
Marketing
It is English like language.
It is much easy to learn.
High level program is just like giving instruction to a person in daily
life.
High level program need preprocessor to convert the program into machine
codes.
Different types of programming languages are FORTRAN, Pascal, C and
C++ etc.
Introduction to programming Chapter 01
After this source code has been converted into object code
Interpreter
An interpreter in another type of translator used for translating a language program into
machine code
It takes one statement of program and translates it into a machine instruction which is
immediately executed by computer
What is Program?
Principles of
Is a set of instructions, or a Marketing
set of sequential instructions which are given to
computer to solve a specific problem.
Programs are written in computer languages like BASIC, PASCAL,C etc.
--------------
--------------
----C/C++--
---program- Run on computer
--------------
--------------
---------------
Introduction to programming Chapter 01
What is Program?
Principles of
Different types of Programs
Marketing
Generally there are THREE types of Programs that’s are created in
a programming Languages:
Source Programs
Object Programs
Executable Programs
Introduction to programming Chapter 01
History of C language
Principles of
The C programming language was designed by Dennies Ritchie in the early 1970’s at
Bell Laboratories. Marketing
It was first used system implementation language for the nascent Unix operating system.
The main reason to devised C was to overcome the limitations of B.
It was Derived from the type-less language BCPL ((Basic Combined Programming
Language).
C was the evolution of B and BCPL by incorporating type checking. It was originally
intended for use in writing compilers for other languages
The new features added to language are templates, namespaces, exception handling and
use of standard library.
Introduction to programming Chapter 01
Thank You
For Your Patience