Program Design Aids

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

1.

Algorithm:

An algorithm is a step-by-step procedure or a set of rules designed to solve a specific problem or perform
a particular task. It's like a recipe in cooking; it tells you exactly what to do, in what order, to achieve the
desired result. Algorithms are essential in computer science and programming because they provide a
clear sequence of instructions that a computer can follow to accomplish a task.

Example: An algorithm to find the sum of two numbers:

1. Start.
2. Take two numbers as input.
3. Add the two numbers.
4. Display the result.
5. End.

2. Flowchart:

A flowchart is a visual representation of an algorithm. It uses different shapes like rectangles, diamonds,
ovals, and arrows to represent the steps, decisions, and flow of the process. Flowcharts make it easier to
understand and follow an algorithm because they provide a graphical overview of the process.

Common Symbols in Flowcharts:

• Oval: Represents the start or end of a process.


• Rectangle: Represents a process or operation.
• Diamond: Represents a decision point.
• Arrows: Indicate the flow of the process from one step to the next.

3. Program:

A program is a set of instructions written in a programming language that a computer can execute to
perform a specific task. It is the implementation of an algorithm in a form that a computer can understand
and run. Programs are written in various programming languages like Python, Java, C++, etc.

Example: Using Python to add two numbers:

python
Copy code
# Python program to add two numbers
num1 = 10
num2 = 5

# Adding two numbers


sum = num1 + num2

# Displaying the result


print("The sum is", sum)

In summary:

• Algorithm: A step-by-step procedure for solving a problem.


• Flowchart: A visual diagram representing an algorithm.
• Program: The actual code written in a programming language that implements the algorithm.

You might also like