0% found this document useful (0 votes)
15 views8 pages

Algorithm & Program

An algorithm is a step-by-step set of instructions to solve a problem, while a program is the implementation of those instructions in a programming language. Algorithms are language-independent and focus on clear, effective steps, whereas programs are executable and require programming skills. Both are essential for problem-solving in computing.

Uploaded by

Soujay Ghoshal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views8 pages

Algorithm & Program

An algorithm is a step-by-step set of instructions to solve a problem, while a program is the implementation of those instructions in a programming language. Algorithms are language-independent and focus on clear, effective steps, whereas programs are executable and require programming skills. Both are essential for problem-solving in computing.

Uploaded by

Soujay Ghoshal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Algorithm &

Program
What is an Algorithm?
• Definition: An algorithm is a step-by-step set of instructions
to solve a problem or perform a task.
Example: Algorithm to make tea:
• Boil water
• Add tea leaves
• Add sugar and milk
• Boil again
• Filter and serve
• Key Idea: Algorithms are language-independent and can be
written in plain English.
Features of an Algorithm

• Clear and unambiguous steps


• Has a definite start and end
• Takes input and produces output
• Should be effective (workable)
What is a Program?
Definition: A program is a set of instructions written in a
programming language (like Python) that a computer can
execute.
• Purpose: To automate tasks using logic written as
code.
From Algorithm to Program
Example: Adding Two Numbers
Algorithm:
• Start
• Get two numbers
• Add them
• Display the result
• Stop
Differences at a Glance

Algorithm Program
Language-free Written in code
Step-by-step logic Executable instructions
Easy to understand Requires programming skills
Summary

• Algorithm = plan or method


• Program = implementation of the plan in code
• Both are essential for solving problems using computers
Basic Python Commands to Learn
1.print() – Display text or values on the First
screen
2.input() – Accept input from the user
3.Variable assignment – x = 10
4.Basic data types – int, float, str, bool
5.Arithmetic operations – +, -, *, /, %
6.Comparison operators – ==, !=, >, <,
>=, <=
7.Logical operators – and, or, not
8.if, elif, else – Decision-making
9.for, while loops – Repeating actions
10.# – Add comments to your code

You might also like