Introduction To Algorithms and Programming Languages
Introduction To Algorithms and Programming Languages
Algorithm
An algorithm is a step-by-step procedure to solve a given problem or an
algorithm as a set or list of instructions for carrying out some process step by step.
Features of Algorithm
An algorithm should have the below mentioned characteristics
Step 1: Start.
Step 2: Take three variables with names num1, num2, num3.
Step 3: Input the values for two variables: num1 = 10, num2 = 5.
Step 4: A
dd num1 & num2 and put its value to num3:
num3 = num1 + num2.
Here both operands num1 and num2 are added and its combined value is assigned
to num3.
Step 5: Now print the value of num3.
Step 6: Stop.
Example2: Algorithm for of finding biggest number of two numbers with one
Pseudo code:
• Acts as a bridge between the program and the algorithm or flowchart. Also
works as a rough documentation, so the program of one developer can be
understood easily when a pseudo code is written out. In industries, the
approach of documentation is essential. And that’s where a pseudo-code
proves vital.
• The main goal of a pseudo code is to explain what exactly each line of a
program should do, hence making the code construction phase easier for the
programmer.
1. Read num1.num2
3. Print num2
Flow Charts
Flowcharting Symbols
2. Flowchart symbols have an entry point on the top of the symbol with no
other entry points. The exit point for all flowchart symbols is on the bottom
except for the Decision symbol.
3. The Decision symbol has two exit points; these can be on the sides or the
bottom and one side.
START
READ NUM1,
NUM2
PRINT NUM3
END
3. Print Num3
Programming languages have been developed over the years in a phased manner. The
programming language in terms of their performance reliability and robustness can
be grouped into five different generations.
1. First generation languages (1GL)
2. Second generation languages (2GL)
3. Third generation languages (3GL)
4. Fourth generation languages (4GL)
5. Fifth generation languages (5GL)
• They are translation free and can be directly executed by the computers.
• The programs written in these languages are executed very speedily and
efficiently by the CPU of the computer system.
• The programs written in these languages utilize the memory in an efficient
manner because it is possible to keep track of each bit of data.