0% found this document useful (0 votes)
2 views5 pages

Program

The document explains the concepts of algorithms, programs, and processes in computing, highlighting their relationships and differences. It outlines how algorithms serve as step-by-step plans that can be implemented as programs, which are then executed as processes. Additionally, it differentiates between coding and programming, and defines primitive data types in programming.

Uploaded by

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

Program

The document explains the concepts of algorithms, programs, and processes in computing, highlighting their relationships and differences. It outlines how algorithms serve as step-by-step plans that can be implemented as programs, which are then executed as processes. Additionally, it differentiates between coding and programming, and defines primitive data types in programming.

Uploaded by

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

Program: A set of instructions stored on disk.

Process: A program in execution with resources like memory and CPU.


Write representation of algorithm
An algorithm is a procedure used for solving a problem or performing a computation.
Algorithms act as an exact list of instructions that conduct specified actions step by
step in either hardware- or software-based routines. Algorithms are widely used
throughout all areas of IT
An algorithm can be represented in three main ways:
Natural Language:
Simple steps in plain language.

Example:
Start
Add 2 numbers
Show result
Stop
Flowchart:
Uses symbols (e.g., ovals for Start/End, rectangles for processes, diamonds for decisions).
Pseudocode:
Looks like code but is easy to read.
Start
Input A, B
Sum = A + B
Print Sum
End
These help to plan and understand the steps before writing real code
What is a program in relation to an algorithm? In what order does an algorithm solve a
problem?
A program is the implementation of an algorithm in a programming language.

 Algorithm = Step-by-step plan

 Program = Code written to follow that plan

 An algorithm solves a problem in a sequential order

Difference between program, process and


algorithm
✅ Visual Chart
Concept Description Urdu Meaning Example
Algorithm Step-by-step plan or logic ‫طریقہ کار‬ Steps to add two numbers
Code written in a language like
Program ‫کم پ ی و ٹ ر پ ر وگ ر ا م‬ sum = a + b
Python
Code actually running on
Process Program being executed by computer )‫عمل (چلتی ہوئی حالت‬
PC

🧪 Python Example

Let's say we want to add two numbers.

1️⃣ Algorithm (Logic only):

 Step 1: Take two numbers


 Step 2: Add them
 Step 3: Show the result

2️⃣ Program (Code written):

python
CopyEdit
# This is a simple program
a = 5
b = 3
sum = a + b
print("The sum is:", sum)

3️⃣ Process (When you run it):

 When you run the above code, it becomes a process in your computer’s memory.
 The computer uses CPU and RAM to complete the task.

🎯 Summary in One Line:

Algorithm is the idea → Program is the written form → Process is the action (execution).
Difference Between Programming and Coding
Term Description Urdu Meaning Example

Writing
Writing lines of code in a specific programming
Coding ‫کوڈ لکھنا‬ print("Hello") in
language (like Python, Java, etc.)
Python

The broader process of planning, designing, ‫مکمل سافٹ‬


Creating a full calculator
Programming testing, and building software — which ‫ویئر بنانے کا‬
app
includes coding ‫عمل‬

✅ In Simple Words:

 Coding is just about writing code.


 Programming includes:
o Thinking of how the software will work
o Designing algorithms
o Writing code (coding)
o Testing and debugging
o Maintaining and improving the software

🎯 Example:

You want to build a calculator app:

Task Is it Coding or Programming?

Writing a + b in Python ✅ Coding

Planning how the app should work ✅ Programming

Designing the user interface ✅ Programming

Fixing bugs in the app ✅ Programming

🧠 Analogy:

Think of building a house:

 Coding is like laying the bricks.


 Programming is like being the architect, engineer, and builder — handling the whole
project.

🔹 What is Meant by Primitives?


In computer science or programming, primitives (also called primitive data types) are the
basic building blocks of data. These are simple data types provided directly by a programming
language.

✅ Examples of Primitive Data Types (Common in most languages):

Data Type Description Example


Integer (int) Whole numbers 5, -20, 100
Float (float) Decimal numbers 3.14, -0.5
Single
Character (char) 'A', '@', '9'
letter/symbol
True or False
Boolean (bool) True, False
value
String (in some "Hello" (Note: In some languages, strings are not
Text
languages) primitive)

🧠 In Simple Words:

Primitives are the basic types of values your code can work with — like numbers, letters, or
true/false.

📘 Urdu Meaning:

Primitive data types ‫کا مطلب ہے بنیادی ڈیٹا اقسام — یعنی سب سے سادہ اور بنیادی اقسام جن سے دوسرے پیچیدہ ڈیٹا‬
‫بنائے جاتے ہیں۔‬

💡 Python Example:
python
CopyEdit
x = 5 # Integer (primitive)
pi = 3.14 # Float (primitive)
letter = 'A' # Character (primitive, part of string in Python)
is_valid = True # Boolean (primitive)

You might also like