2. DEFINITIONS
PROGRAM
A set of instructions that tells a computer what to do is called
program. Computer programs are written in programming languages.
A person who develops a program is called programmer. The
programmer develops programs to instruct the computer how to
process data to convert into information. Programmer uses
programming languages or tools to write programs.
A person can be good programmer if he has the skill of solving
problems. Different problem-solving techniques are as follows:
• Program
• Algorithm
• Flowchart etc.
Nida Chaudhary
3. ALGORITHM
An algorithmis a step-by-step procedure to solve a problem. The process of solving a problem becomes
simpler and easier with help of algorithm. It is better to write algorithmbefore writingthe actual
computer program.
PROPERTIES OF ALGORITHM: Following are some properties of an algorithm,
• The given problem should be broken down into simple and meaningful steps.
• The steps should be numbered sequentially.
• The steps should be descriptive and written in simple English.
Nida Chaudhary
4. PSEUDO CODE
Algorithmsare written in a language that is similar to simple English called pseudo code. There is no
standardto write pseudo code.
Pseudo code simplifies program development by separating it into two main parts.
1. LOGIC DESIGN: In this part, the logic of the program is designed. We specify different steps required
to solve the problem and the sequence of these steps.
2. CODING: In this part, the algorithm is converted into a program. The steps of algorithm are
translated into instructions of any programming language.
Nida Chaudhary
5. Example 1
The following algorithm inputs two numbers, calculates
sum and then display result on screen.
1. Start
2. Input A
3. Input B
4. Total = A + B
5. Display Total
6. Exit.
Nida Chaudhary
6. The following algorithm finds the sum of first fifty
natural numbers.
1. Start
2. sum = 0
3. N = 0
4. Repeat Step 5 and 6 While (N <= 50)
5. sum =sum + N
6. N=N+1
7. Print sum
8. End
Example 4
Nida Chaudhary
8. DIFFERENCE BETWEEN FLOWCHART & ALGORITHM
No Flowchart Algorithm
1
Standard symbols are used to
design flowchart.
Simple English is used to write
algorithm.
2 Flowchart is more time-consuming. Algorithm is less time-consuming.
3 It is difficult to modify. It is easier to modify.
4
It is a graphical representation of
solution.
It is a step-by-step procedure to
solve a problem.
Nida Chaudhary