Basic Programming Handouts
Basic Programming Handouts
Handout #1
Introduction
IPO Diagram
An algorithm is a finite set of instructions which, if followed, accomplish a particular task. In addition,
every algorithm must satisfy the following criteria:
1. Input: there are zero or more quantities which are externally supplied
2. Output: at least one quantity is produced
3. Definiteness: each instruction must be clear and unambiguous
4. Finiteness: if we trace the instructions of an algorithm, then for all cases, the algorithm will
terminate after a finite number of steps
5. Effectiveness: every instruction must be sufficiently basic that it can in principle be carried out by a
person using only pencil and paper. It is not enough that each operation be definite, but it must also
be feasible.
Digital Computer
A digital computer is a machine (also called hardware) that is capable of storing data and executing
algorithms. It is made up of the following physical components
Software
In loose terms, software refers to computer programs which serve as interface between the user and the
hardware. Software can be categorized into two, namely:
1. System Software
- including operating system, compilers, linkers etc.
1
Introduction to C Programming Handout #1: Introduction
2
2. Application Software
- including word processor, spreadsheet, calculator etc.
A computer program is very much like an algorithm. However, it may not be finite, i.e., a program need
not terminate after a finite number of steps. An example of such a program is an operating system.
1. Low-Level Languages
Low-level languages include:
- machine language (lowest level, defined in terms of zero's and one's)
- assembly language (uses mnemonics)
They are called low-level because they require the programmers to have a good
understanding of the underlying hardware for which the programs are intended to run
Programs written using low-level languages are not portable, i.e. they cannot be executed
in two different and incompatible processors
2. High-Level Languages
High-level languages include:
- FORTRAN
- ALGOL
- COBOL
- PL/1
- BASIC
- Pascal
- C++
- Java
They are called high-level because (1) the language is quasi-English and (2) it does not
require the programmer to know the actual computer hardware
The programs written in high-level languages are able to exhibit portability
2
Introduction to C Programming Handout #1: Introduction
3
Evolutions of C is as follows:
ANSI C 1989