SlideShare a Scribd company logo
Introduction to Programming
Programming is the process of telling a computer what to do using a specific language it
understands. It helps us create software, apps, games, websites, and more!
1. Basic Model of Computation
At its core, a computer works like a machine that:
 Takes Input (from keyboard, mouse, files, etc.)
 Processes it using logic (calculations, decisions)
 Produces Output (on screen, in files, etc.)
This basic model is often described as:
arduino
CopyEdit
INPUT → PROCESS → OUTPUT
Example:
You enter two numbers → Computer adds them → It shows the result.
2. What is an Algorithm?
An algorithm is a step-by-step set of instructions to solve a problem.
Think of it like a recipe:
 Input: Ingredients
 Steps: Mixing, baking
 Output: Cake
Example Algorithm to add two numbers:
1. Start
2. Input two numbers A and B
3. Add A + B and store in SUM
4. Output SUM
5. End
3. What is a Flowchart?
A flowchart is a visual diagram that shows the steps of an algorithm using symbols and arrows.
✨Common Flowchart Symbols:
Symbol Shape Purpose
Oval Start/End
Diamond Decision (Yes/No)
Rectangle Process/Step
Parallelogram Input/Output
➡ Arrow Shows flow
Flowcharts help visualize how a program works before writing code.
4. What is a Programming Language?
A programming language is a special language used to write instructions for a computer.
Some Common Languages:
 Python – easy and beginner-friendly
 C/C++ – powerful and fast
 Java – commonly used for apps
 JavaScript – used in websites
Each language has its own rules (syntax), but all are used to write logic (algorithms).
⚙ 5. Compilation
Compilation is the process of converting your code (which humans understand) into machine
code (which computers understand).
 Source Code → Written by the programmer (e.g., in C)
 Compiler → Converts it into machine language (binary)
 Executable → File the computer can run
Some languages like Python use an interpreter instead of a compiler.
6. Testing and Debugging
After writing your code, you must check that it works properly.
 Testing: Run your program with different inputs to see if it gives correct results.
 Debugging: Finding and fixing errors (bugs) in your program.
There are 3 types of errors:
Type Meaning
Syntax Error Mistake in code structure (e.g., missing colon)
Logic Error Code runs, but gives wrong result
Runtime Error Error occurs while running (e.g., divide by zero)
7. Documentation
Documentation means writing clear explanations about:
 What the program does
 How it works
 How to use it
It helps others (and your future self) understand your code. Good documentation includes:
 Comments in the code
 User guides
 Design notes
Summary Table
Concept What It Means
Model of Computation Input → Process → Output
Algorithm Step-by-step instructions
Flowchart Visual way to show steps
Programming Language Used to write programs
Compilation Converts code into machine language
Testing Checking if program works
Debugging Fixing problems in code
Documentation Explaining what the program does
What is Pseudocode?
Pseudocode is like writing down the steps of a program in plain English. It’s not real code, but
it shows how the code should work. You don’t worry about exact syntax (like commas or
brackets), just the logic.
✅Why Use Pseudocode?
 Helps you plan your code before writing it
 Easy to understand, even if you don’t know a programming language yet
 Makes it easier to spot mistakes
 Helps you explain your program to others
✍ How to Write Pseudocode
Use simple steps and common keywords. Here's a quick guide:
Task Pseudocode Keyword
Task Pseudocode Keyword
Start or end BEGIN, END
Take user input INPUT
Show a message OUTPUT or DISPLAY
Set a variable SET or ASSIGN
Make a choice IF, THEN, ELSE
Repeat steps WHILE, FOR
Use another function CALL
Example:
plaintext
CopyEdit
BEGIN
INPUT number
IF number > 0 THEN
OUTPUT "Positive"
ELSE
OUTPUT "Not positive"
END
What is a Flowchart?
A flowchart is a picture that shows the steps in a program using shapes and arrows. It’s a visual
way to understand how a program works.
Common Flowchart Symbols
Symbol Shape Use
Start/End Oval Shows where the program starts or ends
Process Rectangle A step that does something (like a calculation)
Decision Diamond A question with yes/no answers
Input/Output Parallelogram For reading input or showing output
Arrow ➡ Line Shows the direction of steps
How to Use Flowcharts
1. Start with the "Start" symbol
2. Add steps (input, processing, decisions)
3. Use arrows to show the order
4. End with the "End" symbol
Example: Password Checker
Goal: Check if a password is:
 At least 8 characters long
 Contains at least one number
✅Valid Passwords:
 super123
 meandmy2dogs
❌Invalid Passwords:
 hello (too short)
 password (no number)
Pseudocode for Password Checker
plaintext
CopyEdit
BEGIN
INPUT password
SET length = 0
SET has_number = False
WHILE length < length of password
SET current = character at position length
INCREMENT length by 1
IF current is a number THEN
SET has_number = True
IF length >= 8 AND has_number is True THEN
OUTPUT "Valid Password"
ELSE
OUTPUT "Invalid Password"
END
Flowchart (Explanation)
1. Start
2. Input the password
3. Check each character:
o Count the length
o Check if it’s a number
4. After checking:
o If length ≥ 8 AND there is a number → Valid
o Else → Invalid
5. End
Why Use Both Pseudocode & Flowcharts?
Using both gives you:
 Text view (pseudocode) for programmers
 Visual view (flowchart) for better understanding
 Helps in team projects, planning, and learning
❓ FAQs - Quick Answers
Q: Is pseudocode real code?
A: No, it's a way to describe code in plain English.
Q: Who uses pseudocode?
A: Students, programmers, teachers — anyone planning or learning code.
Q: What’s the difference between an algorithm and a flowchart?
A: An algorithm is a list of steps; a flowchart shows those steps as a picture.
Q: Is pseudocode hard?
A: Not at all! If you can explain what a program should do in plain words, you can write
pseudocode.
Flowchart Symbols (Basics)
Symbol Shape Meaning
Symbol Shape Meaning
Start/End Oval Marks where the flow starts or ends
Input/Output Parallelogram Reads or displays data
Process Rectangle A calculation or assignment
Decision Diamond A Yes/No (True/False) condition
Arrow ➡ Line Shows the flow from step to step
Types of Algorithm/Flowchart Processing
1. Sequential Processing
 Steps are done one after another in order.
2. Decision-Based Processing
 The program chooses a path based on a condition (like if-else).
3. Iterative Processing
 Loops are used to repeat steps (like for, while).
Basic Algorithm + Flowchart Examples
1. Exchanging Values of Two Variables
Algorithm:
1. Input A, B
2. Temp = A
3. A = B
4. B = Temp
5. Output A, B
Flowchart Keywords: Input → Process → Output
➕2. Summation of N Numbers
Algorithm:
1. Input N
2. Set Sum = 0
3. Repeat from i = 1 to N:
o Input number
o Sum = Sum + number
4. Output Sum
Flowchart Type: Iterative
3. Decimal to Binary Conversion
Algorithm:
1. Input decimal number n
2. While n > 0:
o Remainder = n % 2
o Store remainder
o n = n // 2
3. Print remainders in reverse order
Flowchart Type: Iterative + Stack logic (store remainders)
4. Reversing Digits of an Integer
Algorithm:
1. Input number n
2. Set reverse = 0
3. While n > 0:
o digit = n % 10
o reverse = reverse * 10 + digit
o n = n // 10
4. Output reverse
5. GCD of Two Numbers
Algorithm (Euclid’s Method):
1. Input A, B
2. While B ≠ 0:
o Temp = B
o B = A % B
o A = Temp
3. Output A (GCD)
6. Test if a Number is Prime
Algorithm:
1. Input number n
2. If n < 2 → Not Prime
3. Check if any number from 2 to √n divides n
o If yes → Not Prime
o Else → Prime
❗ 7. Factorial of a Number
Algorithm:
1. Input n
2. Set fact = 1
3. For i = 1 to n:
o fact = fact * i
4. Output fact
8. Fibonacci Sequence
Algorithm:
1. Input n
2. Set a = 0, b = 1
3. For i = 1 to n:
o Print a
o next = a + b
o a = b
o b = next
9. Evaluate sin(x) Using Series
Use the Taylor Series:
sin(x) = x - x³/3! + x⁵/5! - x⁷/7! + ...
Algorithm:
1. Input x, number of terms
2. Set sign = 1, sinx = 0, term = x
3. Repeat with increasing odd powers and alternating signs
4. Output sinx
10. Reverse Order of Elements in an Array
Algorithm:
1. Input array A[0...n-1]
2. Set start = 0, end = n-1
3. While start < end:
o Swap A[start] and A[end]
o start++, end--
4. Output array
11. Find Largest Number in an Array
Algorithm:
1. Input array A[0...n-1]
2. Set max = A[0]
3. For i = 1 to n-1:
o If A[i] > max → max = A[i]
4. Output max
12. Print Elements of Upper Triangular Matrix
For matrix A[i][j], upper triangle includes elements where i ≤ j
Algorithm:
1. Input matrix A[n][n]
2. For i = 0 to n-1:
o For j = 0 to n-1:
 If i ≤ j → Print A[i][j]
 Else → Print 0
✅Summary Chart
Problem Type of Processing
Swap Two Numbers Sequential
Sum of Numbers Iterative
Decimal to Binary Iterative
Reverse Digits Iterative
GCD Iterative (with condition)
Prime Test Decision + Iterative
Factorial Iterative
Fibonacci Iterative
sin(x) Iterative
Reverse Array Iterative
Largest in Array Iterative + Decision
Upper Triangular Matrix Nested Iteration + Condition

More Related Content

Similar to Introduction to programming : flowchart, algorithm (20)

PPTX
Lec-ProblemSolving.pptx
miansaad18
 
PPTX
Unit 1 c programming language Tut and notes
achiver792
 
PDF
Cse115 lecture03problemsolving
Md. Ashikur Rahman
 
PPTX
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
PPT
Fundamentals of Programming Chapter 3
Mohd Harris Ahmad Jaal
 
PPTX
Cs1123 2 comp_prog
TAlha MAlik
 
DOCX
programming concept
Nehabhy
 
PPTX
Introduction to problem solving Techniques
merlinjohnsy
 
PDF
2021 CSE031.Lecture 6.Flow_Charts_Pseudocode.pptx.pdf
CursedPirate
 
PPTX
Programming C ppt for learning foundations
ssuser65733f
 
PPTX
Pj01 1-computer and programming fundamentals
SasidharaRaoMarrapu
 
PPTX
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
AbdelrahmanRagab36
 
PPT
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
cosc242101003
 
PDF
Algorithmic problem sloving
Mani Kandan
 
PPT
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
Kirti Verma
 
PPTX
UNIT 1.pptx
ShaswatSurya
 
PPTX
Algorithm and pseudo codes
hermiraguilar
 
PDF
Algorithm.pdf
MIT,Imphal
 
PDF
ALGORITHMS AND FLOWCHARTS
Kate Campbell
 
PDF
Flowcharts. Algorithms and pseudo codepdf
BravineMwaba
 
Lec-ProblemSolving.pptx
miansaad18
 
Unit 1 c programming language Tut and notes
achiver792
 
Cse115 lecture03problemsolving
Md. Ashikur Rahman
 
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Fundamentals of Programming Chapter 3
Mohd Harris Ahmad Jaal
 
Cs1123 2 comp_prog
TAlha MAlik
 
programming concept
Nehabhy
 
Introduction to problem solving Techniques
merlinjohnsy
 
2021 CSE031.Lecture 6.Flow_Charts_Pseudocode.pptx.pdf
CursedPirate
 
Programming C ppt for learning foundations
ssuser65733f
 
Pj01 1-computer and programming fundamentals
SasidharaRaoMarrapu
 
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
AbdelrahmanRagab36
 
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
cosc242101003
 
Algorithmic problem sloving
Mani Kandan
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
Kirti Verma
 
UNIT 1.pptx
ShaswatSurya
 
Algorithm and pseudo codes
hermiraguilar
 
Algorithm.pdf
MIT,Imphal
 
ALGORITHMS AND FLOWCHARTS
Kate Campbell
 
Flowcharts. Algorithms and pseudo codepdf
BravineMwaba
 

More from Kritika Chauhan (19)

PPTX
Dalai Lama Succession Explained | History, Politics & China’s Role
Kritika Chauhan
 
PPTX
Introduction to Python — great for beginners or as a refresher.
Kritika Chauhan
 
PDF
Arduino MCQ Collection: Types, Memory, Applications, and Real-World Uses | Te...
Kritika Chauhan
 
PPTX
Group Captain Shubhanshu Shukla: India’s Return to Space After 41 Years | Ax-...
Kritika Chauhan
 
PDF
50+ Arduino MCQs with Answers | Beginners to Advanced Quiz for Electronics & IoT
Kritika Chauhan
 
PDF
MCQ INTERNET OF THINGS ARDUINO PROGREAMS - EMBEDDED C TYPES OF ARDUINO
Kritika Chauhan
 
DOCX
Write a NumPy program to find the most frequent value in an array. Take two...
Kritika Chauhan
 
PDF
skills-Personality Development Multiple Choice Questions
Kritika Chauhan
 
PPTX
Introduction to Arduino Its components & pins
Kritika Chauhan
 
PDF
Embedded C Programming O Level, C Level students, and diploma holder
Kritika Chauhan
 
PPTX
Introduction to Libre (Beginner Guide) .pptx
Kritika Chauhan
 
PPTX
Presentationonlinebusiness
Kritika Chauhan
 
PPTX
Successpptori
Kritika Chauhan
 
PPTX
Basics Of computer
Kritika Chauhan
 
PPTX
Operator of C language
Kritika Chauhan
 
PPTX
computer types
Kritika Chauhan
 
PPTX
cmd commands project
Kritika Chauhan
 
PPTX
Ppt of blogs
Kritika Chauhan
 
DOCX
Project report on blogs
Kritika Chauhan
 
Dalai Lama Succession Explained | History, Politics & China’s Role
Kritika Chauhan
 
Introduction to Python — great for beginners or as a refresher.
Kritika Chauhan
 
Arduino MCQ Collection: Types, Memory, Applications, and Real-World Uses | Te...
Kritika Chauhan
 
Group Captain Shubhanshu Shukla: India’s Return to Space After 41 Years | Ax-...
Kritika Chauhan
 
50+ Arduino MCQs with Answers | Beginners to Advanced Quiz for Electronics & IoT
Kritika Chauhan
 
MCQ INTERNET OF THINGS ARDUINO PROGREAMS - EMBEDDED C TYPES OF ARDUINO
Kritika Chauhan
 
Write a NumPy program to find the most frequent value in an array. Take two...
Kritika Chauhan
 
skills-Personality Development Multiple Choice Questions
Kritika Chauhan
 
Introduction to Arduino Its components & pins
Kritika Chauhan
 
Embedded C Programming O Level, C Level students, and diploma holder
Kritika Chauhan
 
Introduction to Libre (Beginner Guide) .pptx
Kritika Chauhan
 
Presentationonlinebusiness
Kritika Chauhan
 
Successpptori
Kritika Chauhan
 
Basics Of computer
Kritika Chauhan
 
Operator of C language
Kritika Chauhan
 
computer types
Kritika Chauhan
 
cmd commands project
Kritika Chauhan
 
Ppt of blogs
Kritika Chauhan
 
Project report on blogs
Kritika Chauhan
 
Ad

Recently uploaded (20)

PDF
Living Systems Unveiled: Simplified Life Processes for Exam Success
omaiyairshad
 
PPTX
Mrs Mhondiwa Introduction to Algebra class
sabinaschimanga
 
PDF
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PPTX
Modern analytical techniques used to characterize organic compounds. Birbhum ...
AyanHossain
 
PPTX
IDEAS AND EARLY STATES Social science pptx
NIRANJANASSURESH
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PDF
Right to Information.pdf by Sapna Maurya XI D
Directorate of Education Delhi
 
PPTX
classroom based quiz bee.pptx...................
ferdinandsanbuenaven
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PPTX
THE HUMAN INTEGUMENTARY SYSTEM#MLT#BCRAPC.pptx
Subham Panja
 
PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PPTX
ABDOMINAL WALL DEFECTS:GASTROSCHISIS, OMPHALOCELE.pptx
PRADEEP ABOTHU
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PPTX
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
PPTX
Folding Off Hours in Gantt View in Odoo 18.2
Celine George
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
Living Systems Unveiled: Simplified Life Processes for Exam Success
omaiyairshad
 
Mrs Mhondiwa Introduction to Algebra class
sabinaschimanga
 
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
Modern analytical techniques used to characterize organic compounds. Birbhum ...
AyanHossain
 
IDEAS AND EARLY STATES Social science pptx
NIRANJANASSURESH
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Right to Information.pdf by Sapna Maurya XI D
Directorate of Education Delhi
 
classroom based quiz bee.pptx...................
ferdinandsanbuenaven
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
THE HUMAN INTEGUMENTARY SYSTEM#MLT#BCRAPC.pptx
Subham Panja
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
ABDOMINAL WALL DEFECTS:GASTROSCHISIS, OMPHALOCELE.pptx
PRADEEP ABOTHU
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
Folding Off Hours in Gantt View in Odoo 18.2
Celine George
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
Ad

Introduction to programming : flowchart, algorithm

  • 1. Introduction to Programming Programming is the process of telling a computer what to do using a specific language it understands. It helps us create software, apps, games, websites, and more! 1. Basic Model of Computation At its core, a computer works like a machine that:  Takes Input (from keyboard, mouse, files, etc.)  Processes it using logic (calculations, decisions)  Produces Output (on screen, in files, etc.) This basic model is often described as: arduino CopyEdit INPUT → PROCESS → OUTPUT Example: You enter two numbers → Computer adds them → It shows the result. 2. What is an Algorithm? An algorithm is a step-by-step set of instructions to solve a problem. Think of it like a recipe:  Input: Ingredients  Steps: Mixing, baking  Output: Cake Example Algorithm to add two numbers: 1. Start 2. Input two numbers A and B 3. Add A + B and store in SUM 4. Output SUM 5. End
  • 2. 3. What is a Flowchart? A flowchart is a visual diagram that shows the steps of an algorithm using symbols and arrows. ✨Common Flowchart Symbols: Symbol Shape Purpose Oval Start/End Diamond Decision (Yes/No) Rectangle Process/Step Parallelogram Input/Output ➡ Arrow Shows flow Flowcharts help visualize how a program works before writing code. 4. What is a Programming Language? A programming language is a special language used to write instructions for a computer. Some Common Languages:  Python – easy and beginner-friendly  C/C++ – powerful and fast  Java – commonly used for apps  JavaScript – used in websites Each language has its own rules (syntax), but all are used to write logic (algorithms). ⚙ 5. Compilation Compilation is the process of converting your code (which humans understand) into machine code (which computers understand).
  • 3.  Source Code → Written by the programmer (e.g., in C)  Compiler → Converts it into machine language (binary)  Executable → File the computer can run Some languages like Python use an interpreter instead of a compiler. 6. Testing and Debugging After writing your code, you must check that it works properly.  Testing: Run your program with different inputs to see if it gives correct results.  Debugging: Finding and fixing errors (bugs) in your program. There are 3 types of errors: Type Meaning Syntax Error Mistake in code structure (e.g., missing colon) Logic Error Code runs, but gives wrong result Runtime Error Error occurs while running (e.g., divide by zero) 7. Documentation Documentation means writing clear explanations about:  What the program does  How it works  How to use it It helps others (and your future self) understand your code. Good documentation includes:  Comments in the code  User guides  Design notes Summary Table
  • 4. Concept What It Means Model of Computation Input → Process → Output Algorithm Step-by-step instructions Flowchart Visual way to show steps Programming Language Used to write programs Compilation Converts code into machine language Testing Checking if program works Debugging Fixing problems in code Documentation Explaining what the program does What is Pseudocode? Pseudocode is like writing down the steps of a program in plain English. It’s not real code, but it shows how the code should work. You don’t worry about exact syntax (like commas or brackets), just the logic. ✅Why Use Pseudocode?  Helps you plan your code before writing it  Easy to understand, even if you don’t know a programming language yet  Makes it easier to spot mistakes  Helps you explain your program to others ✍ How to Write Pseudocode Use simple steps and common keywords. Here's a quick guide: Task Pseudocode Keyword
  • 5. Task Pseudocode Keyword Start or end BEGIN, END Take user input INPUT Show a message OUTPUT or DISPLAY Set a variable SET or ASSIGN Make a choice IF, THEN, ELSE Repeat steps WHILE, FOR Use another function CALL Example: plaintext CopyEdit BEGIN INPUT number IF number > 0 THEN OUTPUT "Positive" ELSE OUTPUT "Not positive" END What is a Flowchart? A flowchart is a picture that shows the steps in a program using shapes and arrows. It’s a visual way to understand how a program works. Common Flowchart Symbols Symbol Shape Use Start/End Oval Shows where the program starts or ends Process Rectangle A step that does something (like a calculation) Decision Diamond A question with yes/no answers Input/Output Parallelogram For reading input or showing output Arrow ➡ Line Shows the direction of steps How to Use Flowcharts 1. Start with the "Start" symbol 2. Add steps (input, processing, decisions)
  • 6. 3. Use arrows to show the order 4. End with the "End" symbol Example: Password Checker Goal: Check if a password is:  At least 8 characters long  Contains at least one number ✅Valid Passwords:  super123  meandmy2dogs ❌Invalid Passwords:  hello (too short)  password (no number) Pseudocode for Password Checker plaintext CopyEdit BEGIN INPUT password SET length = 0 SET has_number = False WHILE length < length of password SET current = character at position length INCREMENT length by 1 IF current is a number THEN SET has_number = True IF length >= 8 AND has_number is True THEN OUTPUT "Valid Password" ELSE OUTPUT "Invalid Password" END Flowchart (Explanation)
  • 7. 1. Start 2. Input the password 3. Check each character: o Count the length o Check if it’s a number 4. After checking: o If length ≥ 8 AND there is a number → Valid o Else → Invalid 5. End Why Use Both Pseudocode & Flowcharts? Using both gives you:  Text view (pseudocode) for programmers  Visual view (flowchart) for better understanding  Helps in team projects, planning, and learning ❓ FAQs - Quick Answers Q: Is pseudocode real code? A: No, it's a way to describe code in plain English. Q: Who uses pseudocode? A: Students, programmers, teachers — anyone planning or learning code. Q: What’s the difference between an algorithm and a flowchart? A: An algorithm is a list of steps; a flowchart shows those steps as a picture. Q: Is pseudocode hard? A: Not at all! If you can explain what a program should do in plain words, you can write pseudocode. Flowchart Symbols (Basics) Symbol Shape Meaning
  • 8. Symbol Shape Meaning Start/End Oval Marks where the flow starts or ends Input/Output Parallelogram Reads or displays data Process Rectangle A calculation or assignment Decision Diamond A Yes/No (True/False) condition Arrow ➡ Line Shows the flow from step to step Types of Algorithm/Flowchart Processing 1. Sequential Processing  Steps are done one after another in order. 2. Decision-Based Processing  The program chooses a path based on a condition (like if-else). 3. Iterative Processing  Loops are used to repeat steps (like for, while). Basic Algorithm + Flowchart Examples 1. Exchanging Values of Two Variables Algorithm: 1. Input A, B 2. Temp = A 3. A = B 4. B = Temp 5. Output A, B Flowchart Keywords: Input → Process → Output ➕2. Summation of N Numbers
  • 9. Algorithm: 1. Input N 2. Set Sum = 0 3. Repeat from i = 1 to N: o Input number o Sum = Sum + number 4. Output Sum Flowchart Type: Iterative 3. Decimal to Binary Conversion Algorithm: 1. Input decimal number n 2. While n > 0: o Remainder = n % 2 o Store remainder o n = n // 2 3. Print remainders in reverse order Flowchart Type: Iterative + Stack logic (store remainders) 4. Reversing Digits of an Integer Algorithm: 1. Input number n 2. Set reverse = 0 3. While n > 0: o digit = n % 10 o reverse = reverse * 10 + digit o n = n // 10 4. Output reverse 5. GCD of Two Numbers Algorithm (Euclid’s Method):
  • 10. 1. Input A, B 2. While B ≠ 0: o Temp = B o B = A % B o A = Temp 3. Output A (GCD) 6. Test if a Number is Prime Algorithm: 1. Input number n 2. If n < 2 → Not Prime 3. Check if any number from 2 to √n divides n o If yes → Not Prime o Else → Prime ❗ 7. Factorial of a Number Algorithm: 1. Input n 2. Set fact = 1 3. For i = 1 to n: o fact = fact * i 4. Output fact 8. Fibonacci Sequence Algorithm: 1. Input n 2. Set a = 0, b = 1 3. For i = 1 to n: o Print a o next = a + b o a = b o b = next
  • 11. 9. Evaluate sin(x) Using Series Use the Taylor Series: sin(x) = x - x³/3! + x⁵/5! - x⁷/7! + ... Algorithm: 1. Input x, number of terms 2. Set sign = 1, sinx = 0, term = x 3. Repeat with increasing odd powers and alternating signs 4. Output sinx 10. Reverse Order of Elements in an Array Algorithm: 1. Input array A[0...n-1] 2. Set start = 0, end = n-1 3. While start < end: o Swap A[start] and A[end] o start++, end-- 4. Output array 11. Find Largest Number in an Array Algorithm: 1. Input array A[0...n-1] 2. Set max = A[0] 3. For i = 1 to n-1: o If A[i] > max → max = A[i] 4. Output max 12. Print Elements of Upper Triangular Matrix For matrix A[i][j], upper triangle includes elements where i ≤ j Algorithm: 1. Input matrix A[n][n]
  • 12. 2. For i = 0 to n-1: o For j = 0 to n-1:  If i ≤ j → Print A[i][j]  Else → Print 0 ✅Summary Chart Problem Type of Processing Swap Two Numbers Sequential Sum of Numbers Iterative Decimal to Binary Iterative Reverse Digits Iterative GCD Iterative (with condition) Prime Test Decision + Iterative Factorial Iterative Fibonacci Iterative sin(x) Iterative Reverse Array Iterative Largest in Array Iterative + Decision Upper Triangular Matrix Nested Iteration + Condition